diff options
author | sharkiecodes <lanyi_stroud@brown.edu> | 2025-03-11 16:27:30 -0400 |
---|---|---|
committer | sharkiecodes <lanyi_stroud@brown.edu> | 2025-03-11 16:27:30 -0400 |
commit | 3f54517e96ccff233b1560627995024e137dbdfd (patch) | |
tree | 7c0ce1bb4cb7555425acf44bc5cd15876f90ee77 /src/fields/DimensionField.ts | |
parent | 04669ffeb163688c7aefd7b5face7998252abdca (diff) |
Doing outpainting implementation
Diffstat (limited to 'src/fields/DimensionField.ts')
-rw-r--r-- | src/fields/DimensionField.ts | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/fields/DimensionField.ts b/src/fields/DimensionField.ts new file mode 100644 index 000000000..ffbb9a732 --- /dev/null +++ b/src/fields/DimensionField.ts @@ -0,0 +1,29 @@ +import { ObjectField } from "./ObjectField"; +import { Copy, ToJavascriptString, ToScriptString, ToString } from "./FieldSymbols"; + +export class DimensionField extends ObjectField { + width: number; + height: number; + + constructor(width: number, height: number) { + super(); + this.width = width; + this.height = height; + } + + [Copy](): DimensionField { + return new DimensionField(this.width, this.height); + } + + [ToJavascriptString](): string { + return `{ width: ${this.width}, height: ${this.height} }`; + } + + [ToScriptString](): string { + return `{ width: ${this.width}, height: ${this.height} }`; + } + + [ToString](): string { + return `${this.width} x ${this.height}`; + } +} |