aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/views/InkingStroke.tsx13
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>
}