diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/InkControls.tsx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/client/views/InkControls.tsx b/src/client/views/InkControls.tsx index b97075489..e4861c086 100644 --- a/src/client/views/InkControls.tsx +++ b/src/client/views/InkControls.tsx @@ -97,7 +97,7 @@ export class InkControls extends React.Component<InkControlProps> { } const addedPoints = this.props.addedPoints; const [left, top, scaleX, scaleY, strokeWidth, screenSpaceLineWidth] = this.props.format; - const rectHdlSize = this._overControl === i ? screenSpaceLineWidth * 6 : screenSpaceLineWidth * 4; + const rectHdlSize = (i: number) => this._overControl === i ? screenSpaceLineWidth * 6 : screenSpaceLineWidth * 4; return ( <> {addedPoints.map((pts, i) => @@ -119,10 +119,10 @@ export class InkControls extends React.Component<InkControlProps> { {controlPoints.map((control, i) => <svg height="10" width="10" key={`ctrl${i}`}> <rect - x={(control.X - left - strokeWidth / 2) * scaleX + strokeWidth / 2 - rectHdlSize / 2} - y={(control.Y - top - strokeWidth / 2) * scaleY + strokeWidth / 2 - rectHdlSize / 2} - height={rectHdlSize} - width={rectHdlSize} + x={(control.X - left - strokeWidth / 2) * scaleX + strokeWidth / 2 - rectHdlSize(i) / 2} + y={(control.Y - top - strokeWidth / 2) * scaleY + strokeWidth / 2 - rectHdlSize(i) / 2} + height={rectHdlSize(i)} + width={rectHdlSize(i)} strokeWidth={screenSpaceLineWidth / 2} stroke={Colors.MEDIUM_BLUE} fill={formatInstance?._currentPoint === control.I ? Colors.MEDIUM_BLUE : Colors.WHITE} |