From ea95bd9719623117fdf73a290633ae20839976f0 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Fri, 22 Jul 2022 09:29:18 -0400
Subject: changed ink width to be scaled by document scale to make it look like
 ink stroke is the same regardless of the native width of the document being
 drawn on.

---
 .../collectionFreeForm/CollectionFreeFormView.tsx  | 25 ++++++++++++++++------
 1 file changed, 18 insertions(+), 7 deletions(-)

(limited to 'src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx')

diff --git a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
index d9de5002b..5d7a12122 100644
--- a/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
+++ b/src/client/views/collections/collectionFreeForm/CollectionFreeFormView.tsx
@@ -570,13 +570,24 @@ export class CollectionFreeFormView extends CollectionSubView<Partial<collection
             case GestureUtils.Gestures.Stroke:
                 const points = ge.points;
                 const B = this.getTransform().transformBounds(ge.bounds.left, ge.bounds.top, ge.bounds.width, ge.bounds.height);
-                const inkDoc = Docs.Create.InkDocument(ActiveInkColor(), Doc.ActiveTool, ActiveInkWidth(), ActiveInkBezierApprox(), ActiveFillColor(), ActiveArrowStart(), ActiveArrowEnd(), ActiveDash(), points, {
-                    title: 'ink stroke',
-                    x: B.x - ActiveInkWidth() / 2,
-                    y: B.y - ActiveInkWidth() / 2,
-                    _width: B.width + ActiveInkWidth(),
-                    _height: B.height + ActiveInkWidth(),
-                });
+                const inkDoc = Docs.Create.InkDocument(
+                    ActiveInkColor(),
+                    Doc.ActiveTool,
+                    ActiveInkWidth() * this.props.ScreenToLocalTransform().Scale,
+                    ActiveInkBezierApprox(),
+                    ActiveFillColor(),
+                    ActiveArrowStart(),
+                    ActiveArrowEnd(),
+                    ActiveDash(),
+                    points,
+                    {
+                        title: 'ink stroke',
+                        x: B.x - ActiveInkWidth() / 2,
+                        y: B.y - ActiveInkWidth() / 2,
+                        _width: B.width + ActiveInkWidth() * this.props.ScreenToLocalTransform().Scale,
+                        _height: B.height + ActiveInkWidth() * this.props.ScreenToLocalTransform().Scale,
+                    }
+                );
                 if (Doc.ActiveTool === InkTool.Write) {
                     this.unprocessedDocs.push(inkDoc);
                     CollectionFreeFormView.collectionsWithUnprocessedInk.add(this);
-- 
cgit v1.2.3-70-g09d2

