From 39e1e9f550be2ae128a32f58f35da40e09f54345 Mon Sep 17 00:00:00 2001
From: Tyler Schicke <tyler_schicke@brown.edu>
Date: Tue, 19 Feb 2019 06:25:29 -0500
Subject: Fixed bug with resizing

---
 src/client/views/DocumentDecorations.tsx | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

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

diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 62a1899bb..48f5f01a1 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -127,16 +127,14 @@ export class DocumentDecorations extends React.Component {
                 let width = doc.GetOrCreate(KeyStore.Width, NumberField);
                 let height = doc.GetOrCreate(KeyStore.Height, NumberField);
                 let x = doc.GetOrCreate(KeyStore.X, NumberField);
-                let y = doc.GetOrCreate(KeyStore.X, NumberField);
+                let y = doc.GetOrCreate(KeyStore.Y, NumberField);
                 let scale = width.Data / rect.width;
                 let actualdW = Math.max(width.Data + (dW * scale), 20);
                 let actualdH = Math.max(height.Data + (dH * scale), 20);
                 x.Data += dX * (actualdW - width.Data);
                 y.Data += dY * (actualdH - height.Data);
-                if (Math.abs(dW) > Math.abs(dH))
-                    width.Data = actualdW;
-                else
-                    height.Data = actualdH;
+                width.Data = actualdW;
+                height.Data = actualdH;
             }
         })
     }
-- 
cgit v1.2.3-70-g09d2

