From ffa36a87eb1093883dcc80128b08d24d2440f75a Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Wed, 5 Aug 2020 13:01:52 -0400
Subject: fixed perfectly horizontal/vertical lines to display.  make InkFields
 script editable.

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

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

diff --git a/src/client/views/InkingStroke.tsx b/src/client/views/InkingStroke.tsx
index fe5bf1eb2..6c5eda256 100644
--- a/src/client/views/InkingStroke.tsx
+++ b/src/client/views/InkingStroke.tsx
@@ -99,10 +99,10 @@ export class InkingStroke extends ViewBoxBaseComponent<FieldViewProps, InkDocume
         const top = Math.min(...ys) - strokeWidth / 2;
         const right = Math.max(...xs) + strokeWidth / 2;
         const bottom = Math.max(...ys) + strokeWidth / 2;
-        const width = right - left;
-        const height = bottom - top;
-        const scaleX = (this.props.PanelWidth() - strokeWidth) / (width - strokeWidth);
-        const scaleY = (this.props.PanelHeight() - strokeWidth) / (height - strokeWidth);
+        const width = Math.max(right - left);
+        const height = Math.max(1, bottom - top);
+        const scaleX = width === strokeWidth ? 1 : (this.props.PanelWidth() - strokeWidth) / (width - strokeWidth);
+        const scaleY = height === strokeWidth ? 1 : (this.props.PanelHeight() - strokeWidth) / (height - strokeWidth);
         const strokeColor = StrCast(this.layoutDoc.color, "");
 
         const points = InteractionUtils.CreatePolyline(data, left, top, strokeColor, strokeWidth, strokeWidth,
-- 
cgit v1.2.3-70-g09d2

