diff options
| author | bob <bcz@cs.brown.edu> | 2019-09-17 15:30:02 -0400 |
|---|---|---|
| committer | bob <bcz@cs.brown.edu> | 2019-09-17 15:30:02 -0400 |
| commit | 1310633790e3db50a31a1cc6d357306d7884a053 (patch) | |
| tree | ecb506b53f89d9f4fc991b7d99b841e1a1e77337 /src/new_fields/Doc.ts | |
| parent | 9cd476b6cc7a3d72c6b2b96630506b04a5c6fb22 (diff) | |
cleaning up icon animations
Diffstat (limited to 'src/new_fields/Doc.ts')
| -rw-r--r-- | src/new_fields/Doc.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/new_fields/Doc.ts b/src/new_fields/Doc.ts index 2434a439a..614babd3c 100644 --- a/src/new_fields/Doc.ts +++ b/src/new_fields/Doc.ts @@ -143,8 +143,14 @@ export class Doc extends RefField { private [Self] = this; private [SelfProxy]: any; - public [WidthSym] = () => NumCast(this[SelfProxy].width); // bcz: is this the right way to access width/height? it didn't work with : this.width - public [HeightSym] = () => NumCast(this[SelfProxy].height); + public [WidthSym] = () => { + let iconAnimating = this[SelfProxy].isIconAnimating ? Array.from(Cast(this[SelfProxy].isIconAnimating, listSpec("number"))!) : undefined; + return iconAnimating ? iconAnimating[0] : NumCast(this[SelfProxy].width); + } + public [HeightSym] = () => { + let iconAnimating = this[SelfProxy].isIconAnimating ? Array.from(Cast(this[SelfProxy].isIconAnimating, listSpec("number"))!) : undefined; + return iconAnimating ? iconAnimating[1] : NumCast(this[SelfProxy].height); + } [ToScriptString]() { return "invalid"; |
