aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorkimdahey <vjk1883@gmail.com>2021-09-13 18:03:56 -0400
committerkimdahey <vjk1883@gmail.com>2021-09-13 18:03:56 -0400
commit02a6d5404f23ffb486e183d68d3af71728e85f09 (patch)
treeae2d560c99c1484d4e3dda77a49f03b9db0a4515 /src
parent9a4bd3ca5dbe192eec20bf405a9904ef8b546de6 (diff)
working on control points
Diffstat (limited to 'src')
-rw-r--r--src/client/views/InkControls.tsx4
-rw-r--r--src/client/views/InkingStroke.tsx26
2 files changed, 23 insertions, 7 deletions
diff --git a/src/client/views/InkControls.tsx b/src/client/views/InkControls.tsx
index 6213a4075..46377380a 100644
--- a/src/client/views/InkControls.tsx
+++ b/src/client/views/InkControls.tsx
@@ -121,8 +121,8 @@ export class InkControls extends React.Component<InkControlProps> {
<rect
x={(control.X - left - strokeWidth / 2) * scaleX}
y={(control.Y - top - strokeWidth / 2) * scaleY}
- height={this._overControl === i ? strokeWidth * 1.5 : strokeWidth}
- width={this._overControl === i ? strokeWidth * 1.5 : strokeWidth}
+ height={this._overControl === i ? strokeWidth * 6 : strokeWidth * 3}
+ width={this._overControl === i ? strokeWidth * 6 : strokeWidth * 3}
strokeWidth={strokeWidth / 6} stroke={Colors.MEDIUM_BLUE}
fill={formatInstance?._currentPoint === control.I ? Colors.MEDIUM_BLUE : Colors.WHITE}
onPointerDown={(e) => {
diff --git a/src/client/views/InkingStroke.tsx b/src/client/views/InkingStroke.tsx
index e713cedee..771419937 100644
--- a/src/client/views/InkingStroke.tsx
+++ b/src/client/views/InkingStroke.tsx
@@ -126,6 +126,11 @@ export class InkingStroke extends ViewBoxBaseComponent<FieldViewProps, InkDocume
const overlayWidth = 3;
const screenOrigin = this.props.ScreenToLocalTransform().inverse().transformPoint(0, 0);
+
+ const addedPoints = InteractionUtils.CreatePoints(inkData, screenLeft, screenTop, StrCast(inkDoc.strokeColor, "none"), screenInkWidth[0], overlayWidth,
+ StrCast(this.layoutDoc.strokeBezier), StrCast(this.layoutDoc.fillColor, "none"), StrCast(this.layoutDoc.strokeStartMarker),
+ StrCast(this.layoutDoc.strokeEndMarker), StrCast(this.layoutDoc.strokeDash), inkScaleX, inkScaleY, "", "none", this.props.isSelected() && inkStrokeWidth <= 5, false);
+
return <div className="inkstroke-UI" style={{
left: screenOrigin[0],
top: screenOrigin[1],
@@ -135,7 +140,20 @@ export class InkingStroke extends ViewBoxBaseComponent<FieldViewProps, InkDocume
StrCast(inkDoc.strokeBezier), StrCast(inkDoc.fillColor, "none"),
StrCast(inkDoc.strokeStartMarker), StrCast(inkDoc.strokeEndMarker),
StrCast(inkDoc.strokeDash), inkScaleX, inkScaleY, "", "none", 1.0, false)}
-
+ {this._properties?._controlButton ?
+ <>
+ <InkControls
+ inkDoc={inkDoc}
+ data={screenPts}
+ addedPoints={addedPoints}
+ format={[screenLeft, screenTop, inkScaleX, inkScaleY, screenInkWidth[0]]}
+ ScreenToLocalTransform={this.props.ScreenToLocalTransform} />
+ <InkHandles
+ inkDoc={inkDoc}
+ data={screenPts}
+ format={[screenLeft, screenTop, inkScaleX, inkScaleY, screenInkWidth[0]]}
+ ScreenToLocalTransform={this.props.ScreenToLocalTransform} />
+ </> : ""}
</div>
}
@@ -161,8 +179,6 @@ export class InkingStroke extends ViewBoxBaseComponent<FieldViewProps, InkDocume
const clickableLine = InteractionUtils.CreatePolyline(inkData, inkLeft, inkTop, "transparent", inkStrokeWidth, inkStrokeWidth + 15, StrCast(this.layoutDoc.strokeBezier),
StrCast(this.layoutDoc.fillColor, "none"), "none", "none", undefined, inkScaleX, inkScaleY, "", this.props.layerProvider?.(this.props.Document) === false ? "none" : "visiblepainted", 0.0, true);
// Set of points rendered upon the ink that can be added if a user clicks on one.
- const addedPoints = InteractionUtils.CreatePoints(inkData, inkLeft, inkTop, strokeColor, inkStrokeWidth, inkStrokeWidth, StrCast(this.layoutDoc.strokeBezier), StrCast(this.layoutDoc.fillColor, "none"), StrCast(this.layoutDoc.strokeStartMarker),
- StrCast(this.layoutDoc.strokeEndMarker), StrCast(this.layoutDoc.strokeDash), inkScaleX, inkScaleY, "", "none", this.props.isSelected() && inkStrokeWidth <= 5, false);
return (
<svg className="inkStroke"
@@ -186,7 +202,7 @@ export class InkingStroke extends ViewBoxBaseComponent<FieldViewProps, InkDocume
{clickableLine}
{inkLine}
{/* {this.props.isSelected() ? selectedLine : ""} */}
- {this.props.isSelected() && this._properties?._controlButton ?
+ {/* {this.props.isSelected() && this._properties?._controlButton ?
<>
<InkControls
inkDoc={inkDoc}
@@ -199,7 +215,7 @@ export class InkingStroke extends ViewBoxBaseComponent<FieldViewProps, InkDocume
data={inkData}
format={[inkLeft, inkTop, inkScaleX, inkScaleY, inkStrokeWidth]}
ScreenToLocalTransform={this.props.ScreenToLocalTransform} />
- </> : ""}
+ </> : ""} */}
</svg>
);
}