diff options
author | bobzel <zzzman@gmail.com> | 2021-09-03 14:58:49 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2021-09-03 14:58:49 -0400 |
commit | da6bc0d484c5d917dca38178f99f1dfc14d2d0ec (patch) | |
tree | fe584d5e03685027e5aef702f685cdeb77fbb4b2 | |
parent | 15bc374105eb7c55493d9ca6c2b12f9bf22735c9 (diff) |
fixed selection stroke offset
-rw-r--r-- | src/client/views/InkingStroke.tsx | 13 |
1 files changed, 6 insertions, 7 deletions
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> } |