From 220cedfb9d013127d89756bcc85ac886a0d723da Mon Sep 17 00:00:00 2001 From: bobzel Date: Thu, 2 Dec 2021 15:40:28 -0500 Subject: moved ink appearance menu to top of properties view. fixed size of arrowheads on selected ink. --- src/client/util/InteractionUtils.tsx | 22 +++++++++++----------- src/client/views/InkingStroke.tsx | 6 +++--- src/client/views/PropertiesView.tsx | 5 +++-- 3 files changed, 17 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/client/util/InteractionUtils.tsx b/src/client/util/InteractionUtils.tsx index 61872417b..3e051dec8 100644 --- a/src/client/util/InteractionUtils.tsx +++ b/src/client/util/InteractionUtils.tsx @@ -107,25 +107,25 @@ export namespace InteractionUtils { const defGuid = Utils.GenerateGuid(); const Tag = (bezier ? "path" : "polyline") as keyof JSX.IntrinsicElements; - const makerStrokeWidth = strokeWidth / 2; - const arrowWidthFactor = 3 * (markerScale ? markerScale : 0.5);// used to be 1.5 - const arrowLengthFactor = 5 * (markerScale ? markerScale : 0.5); - const arrowNotchFactor = 2 * (markerScale ? markerScale : 0.5); + const markerStrokeWidth = strokeWidth / 2; + const arrowWidthFactor = 3 * (markerScale || 0.5);// used to be 1.5 + const arrowLengthFactor = 5 * (markerScale || 0.5); + const arrowNotchFactor = 2 * (markerScale || 0.5); return ( {/* setting the svg fill sets the arrowStart fill */} {nodefs ? (null) : {arrowStart !== "dot" && arrowEnd !== "dot" ? (null) : - + } {arrowStart !== "arrow" ? (null) : - - + + } {arrowEnd !== "arrow" ? (null) : - - + + } } diff --git a/src/client/views/InkingStroke.tsx b/src/client/views/InkingStroke.tsx index 5c7fc94bd..9dbd97c16 100644 --- a/src/client/views/InkingStroke.tsx +++ b/src/client/views/InkingStroke.tsx @@ -250,8 +250,8 @@ export class InkingStroke extends ViewBoxBaseComponent { const inkDoc = this.props.Document; - const screenSpaceCenterlineStrokeWidth = 3; // the width of the blue line widget that shows the centerline of the ink stroke const { inkData, inkScaleX, inkScaleY, inkStrokeWidth, inkTop, inkLeft } = this.inkScaledData(); + const screenSpaceCenterlineStrokeWidth = Math.min(3, inkStrokeWidth * this.props.ScreenToLocalTransform().inverse().Scale); // the width of the blue line widget that shows the centerline of the ink stroke const screenInkWidth = this.props.ScreenToLocalTransform().inverse().transformDirection(inkStrokeWidth, inkStrokeWidth); const screenPts = inkData.map(point => this.props.ScreenToLocalTransform().inverse().transformPoint( @@ -261,7 +261,7 @@ export class InkingStroke extends ViewBoxBaseComponent {InteractionUtils.CreatePolyline(screenPts, 0, 0, Colors.MEDIUM_BLUE, screenInkWidth[0], screenSpaceCenterlineStrokeWidth, StrCast(inkDoc.strokeLineJoin), StrCast(this.layoutDoc.strokeLineCap), StrCast(inkDoc.strokeBezier), - "none", startMarker, endMarker, markerScale, StrCast(inkDoc.strokeDash), 1, 1, "", "none", 1.0, false)} + "none", startMarker, endMarker, markerScale * Math.min(screenSpaceCenterlineStrokeWidth, screenInkWidth[0] / screenSpaceCenterlineStrokeWidth), StrCast(inkDoc.strokeDash), 1, 1, "", "none", 1.0, false)} {
{this.editableTitle}
+ + {this.inkSubMenu} + {this.optionsSubMenu} {this.sharingSubMenu} {isNovice ? null : this.filtersSubMenu} - {this.inkSubMenu} - {isNovice ? null : this.fieldsSubMenu} {isNovice ? null : this.contextsSubMenu} -- cgit v1.2.3-70-g09d2