aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/nodes/ImageBox.tsx
diff options
context:
space:
mode:
authorTyler Schicke <tyler_schicke@brown.edu>2019-07-29 16:53:52 -0400
committerTyler Schicke <tyler_schicke@brown.edu>2019-07-29 16:53:52 -0400
commit06dfb537826e8b1642783a9c4ab2514fd7da2fe3 (patch)
treeb1d820d02d8fbaf2d1a551f93c434f222857b491 /src/client/views/nodes/ImageBox.tsx
parent5f62e6245ebf406260881236f0b1c2132577205a (diff)
More fixes
Diffstat (limited to 'src/client/views/nodes/ImageBox.tsx')
-rw-r--r--src/client/views/nodes/ImageBox.tsx2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx
index 82af4b4ca..d4e0eaf98 100644
--- a/src/client/views/nodes/ImageBox.tsx
+++ b/src/client/views/nodes/ImageBox.tsx
@@ -291,7 +291,7 @@ export class ImageBox extends DocComponent<FieldViewProps, ImageDocument>(ImageD
let aspect = size.height / size.width;
let rotation = NumCast(this.dataDoc.rotation) % 180;
if (rotation === 90 || rotation === 270) aspect = 1 / aspect;
- if (Math.abs(layoutdoc[HeightSym]() / layoutdoc[WidthSym]() - aspect) > 0.01) {
+ if (Math.abs(NumCast(layoutdoc.height) - size.height) > 1 || Math.abs(NumCast(layoutdoc.width) - size.width) > 1) {
setTimeout(action(() => {
layoutdoc.height = layoutdoc[WidthSym]() * aspect;
layoutdoc.nativeHeight = size.height;