From b6411c0c053db2b4495d0c545c491d9f18238e21 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Fri, 1 Nov 2024 10:53:37 -0400
Subject: fixed resize problem where NaN is generated by scaling very narrow in
 a card view.

---
 src/client/views/DocumentDecorations.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/client/views/DocumentDecorations.tsx')

diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 5a48b6c62..66043c033 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -559,8 +559,8 @@ export class DocumentDecorations extends ObservableReactComponent<DocumentDecora
                 if (setData) Doc.SetNativeHeight(doc[DocData], NumCast(doc._nativeHeight));
             }
 
-            doc._width = Math.max(1, NumCast(doc._width) * scale.x);
-            doc._height = Math.max(1, NumCast(doc._height) * scale.y);
+            doc._width = Math.max(NumCast(doc._width_min, 25), NumCast(doc._width) * scale.x);
+            doc._height = Math.max(NumCast(doc._height_min, 25), NumCast(doc._height) * scale.y);
             const { deltaX, deltaY } = this.realignRefPt(doc, refCent, initWidth, initHeight);
             doc.x = NumCast(doc.x) + deltaX;
             doc.y = NumCast(doc.y) + deltaY;
-- 
cgit v1.2.3-70-g09d2

