From da6bc0d484c5d917dca38178f99f1dfc14d2d0ec Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Fri, 3 Sep 2021 14:58:49 -0400
Subject: fixed selection stroke offset

---
 src/client/views/InkingStroke.tsx | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

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

diff --git a/src/client/views/InkingStroke.tsx b/src/client/views/InkingStroke.tsx
index 41fbe0d55..634cb0dfd 100644
--- a/src/client/views/InkingStroke.tsx
+++ b/src/client/views/InkingStroke.tsx
@@ -118,23 +118,22 @@ export class InkingStroke extends ViewBoxBaseComponent<FieldViewProps, InkDocume
         const { inkData, inkScaleX, inkScaleY, inkStrokeWidth } = this.inkScaledData();
 
         const screenInkWidth = this.props.ScreenToLocalTransform().inverse().transformDirection(inkStrokeWidth, inkStrokeWidth);
-        const screenPts = inkData.map(point => this.props.ScreenToLocalTransform().inverse().transformPoint(point.X * inkScaleX, point.Y * inkScaleY)).map(p => ({ X: p[0], Y: p[1] }));
+        const screenPts = inkData.map(point => this.props.ScreenToLocalTransform().inverse().transformPoint(point.X, point.Y)).map(p => ({ X: p[0], Y: p[1] }));
         const screenTop = Math.min(...screenPts.map(p => p.Y)) - screenInkWidth[0] / 2;
         const screenLeft = Math.min(...screenPts.map(p => p.X)) - screenInkWidth[0] / 2;
 
         const inkDoc = this.props.Document;
-        
+
         const overlayWidth = 5;
+        const screenOrigin = this.props.ScreenToLocalTransform().inverse().transformPoint(0, 0);
         return <div className="inkstroke-UI" style={{
-            // width: (bounds.r - bounds.x) + "px",
-            // height: (bounds.b - bounds.y) + "px",
-            left: screenLeft,
-            top: screenTop,
+            left: screenOrigin[0],
+            top: screenOrigin[1],
         }} >
             {InteractionUtils.CreatePolyline(screenPts, screenLeft, screenTop, Colors.MEDIUM_BLUE, overlayWidth, overlayWidth,
                 StrCast(inkDoc.strokeBezier), StrCast(inkDoc.fillColor, "none"),
                 StrCast(inkDoc.strokeStartMarker), StrCast(inkDoc.strokeEndMarker),
-                StrCast(inkDoc.strokeDash), 1, 1, "", "none", 1.0, false)}
+                StrCast(inkDoc.strokeDash), inkScaleX, inkScaleY, "", "none", 1.0, false)}
 
         </div>
     }
-- 
cgit v1.2.3-70-g09d2

