blob: ffbb9a73291d2ecffe2167f1395e49b4e7111ec6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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}`;
}
}
|