From b033279d56ad82829d1d342b43a0eb342a8c26fe Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Mon, 24 Mar 2025 21:16:23 -0400
Subject: cleanup

---
 src/client/views/nodes/ImageBox.tsx | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

(limited to 'src/client/views/nodes/ImageBox.tsx')

diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx
index a8985a2b7..c737623f5 100644
--- a/src/client/views/nodes/ImageBox.tsx
+++ b/src/client/views/nodes/ImageBox.tsx
@@ -146,11 +146,10 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
             },
             { fireImmediately: true, delay: 1000 }
         );
-        const { layoutDoc } = this;
         this._disposers.path = reaction(
             () => ({ nativeSize: this.nativeSize, width: NumCast(this.layoutDoc._width), height: this.layoutDoc._height }),
             ({ nativeSize, width, height }) => {
-                if ((layoutDoc === this.layoutDoc && !this.layoutDoc._layout_nativeDimEditable) || !height) {
+                if (!this.layoutDoc._layout_nativeDimEditable || !height) {
                     this.layoutDoc._height = (width * nativeSize.nativeHeight) / nativeSize.nativeWidth;
                 }
             },
@@ -252,12 +251,12 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
         const nw = nscale / oldnativeWidth;
         this.dataDoc[this.fieldKey + '_nativeHeight'] = NumCast(this.dataDoc[this.fieldKey + '_nativeHeight']) * nw;
         this.dataDoc[this.fieldKey + '_nativeWidth'] = NumCast(this.dataDoc[this.fieldKey + '_nativeWidth']) * nw;
-        this.dataDoc._freeform_panX = nw * NumCast(this.dataDoc._freeform_panX);
-        this.dataDoc._freeform_panY = nw * NumCast(this.dataDoc._freeform_panY);
-        this.dataDoc._freeform_panX_max = this.dataDoc._freeform_panX_max ? nw * NumCast(this.dataDoc._freeform_panX_max) : undefined;
-        this.dataDoc._freeform_panX_min = this.dataDoc._freeform_panX_min ? nw * NumCast(this.dataDoc._freeform_panX_min) : undefined;
-        this.dataDoc._freeform_panY_max = this.dataDoc._freeform_panY_max ? nw * NumCast(this.dataDoc._freeform_panY_max) : undefined;
-        this.dataDoc._freeform_panY_min = this.dataDoc._freeform_panY_min ? nw * NumCast(this.dataDoc._freeform_panY_min) : undefined;
+        this.dataDoc.freeform_panX = nw * NumCast(this.dataDoc.freeform_panX);
+        this.dataDoc.freeform_panY = nw * NumCast(this.dataDoc.freeform_panY);
+        this.dataDoc.freeform_panX_max = this.dataDoc.freeform_panX_max ? nw * NumCast(this.dataDoc.freeform_panX_max) : undefined;
+        this.dataDoc.freeform_panX_min = this.dataDoc.freeform_panX_min ? nw * NumCast(this.dataDoc.freeform_panX_min) : undefined;
+        this.dataDoc.freeform_panY_max = this.dataDoc.freeform_panY_max ? nw * NumCast(this.dataDoc.freeform_panY_max) : undefined;
+        this.dataDoc.freeform_panY_min = this.dataDoc.freeform_panY_min ? nw * NumCast(this.dataDoc.freeform_panY_min) : undefined;
         const newnativeWidth = NumCast(this.dataDoc[this.fieldKey + '_nativeWidth']);
         DocListCast(this.dataDoc[this.annotationKey]).forEach(doc => {
             doc.x = (NumCast(doc.x) / oldnativeWidth) * newnativeWidth;
@@ -293,12 +292,12 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() {
         const anchw = NumCast(cropping._width);
         const anchh = NumCast(cropping._height);
         const viewScale = NumCast(this.dataDoc[this.fieldKey + '_nativeHeight']) / anchh;
-        cropping.title = 'crop: ' + this.Document.title;
         cropping.x = NumCast(this.Document.x) + NumCast(this.layoutDoc._width);
         cropping.y = NumCast(this.Document.y);
+        cropping.onClick = undefined;
         cropping._width = anchw * (this._props.NativeDimScaling?.() || 1);
         cropping._height = anchh * (this._props.NativeDimScaling?.() || 1);
-        cropping.onClick = undefined;
+        cropping.$title = 'crop: ' + this.Document.title;
         cropping.$annotationOn = undefined;
         cropping.$isDataDoc = true;
         cropping.$backgroundColor = undefined;
-- 
cgit v1.2.3-70-g09d2

