diff options
author | vkalev <vjk1883@gmail.com> | 2021-08-13 10:15:31 -0400 |
---|---|---|
committer | vkalev <vjk1883@gmail.com> | 2021-08-13 10:15:31 -0400 |
commit | b69fe78eadeb2bfa1f284e3e0333734b03b718a9 (patch) | |
tree | 08a7fd8d978fba8a2a25883e051e9bc6570c4ba0 /src/client/views/InkControls.tsx | |
parent | 200585ebdc40b1c9710c8028e4e25965eaa73a9d (diff) |
cleaning up
Diffstat (limited to 'src/client/views/InkControls.tsx')
-rw-r--r-- | src/client/views/InkControls.tsx | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/src/client/views/InkControls.tsx b/src/client/views/InkControls.tsx index 55a70ccd2..6213a4075 100644 --- a/src/client/views/InkControls.tsx +++ b/src/client/views/InkControls.tsx @@ -87,38 +87,16 @@ export class InkControls extends React.Component<InkControlProps> { if (!formatInstance) return (null); // Accessing the current ink's data and extracting all control points. - // Separate case for circle shape (?) const data = this.props.data; - const [left, right, top, bottom, scaleX, scaleY, strokeWidth] = this.props.format; - const centerX = (Math.max(left, right) + Math.min(left, right)) / 2; - const centerY = (Math.max(top, bottom) + Math.min(top, bottom)) / 2; - const radius = Math.max(centerX - Math.min(left, right), centerY - Math.min(top, bottom)); const controlPoints: ControlPoint[] = []; if (data.length >= 4) { - // const distance = Math.sqrt((Math.pow(data[0].X - centerX, 2)) + (Math.pow(data[0].Y - centerY, 2))); - // if (Math.abs(distance - radius) <= 2.5) { - // controlPoints.push({ X: data[0].X, Y: data[0].Y, I: 0 }); - // const topPoint = formatInstance.rotatePoint(data[0], { X: centerX, Y: centerY }, Math.PI / 2); - // const rightPoint = formatInstance.rotatePoint(data[0], { X: centerX, Y: centerY }, Math.PI); - // const bottomPoint = formatInstance.rotatePoint(data[0], { X: centerX, Y: centerY }, Math.PI * 1.5); - // for (let i = 0; i <= data.length - 4; i += 4) { - // const currPoint = data[i]; - // const isTopPoint = Math.sqrt((Math.pow(currPoint.X - topPoint.X, 2)) + (Math.pow(currPoint.Y - topPoint.Y, 2))) <= 2.5; - // const isRightPoint = Math.sqrt((Math.pow(currPoint.X - rightPoint.X, 2)) + (Math.pow(currPoint.Y - rightPoint.Y, 2))) <= 2.5; - // const isBottomPoint = Math.sqrt((Math.pow(currPoint.X - bottomPoint.X, 2)) + (Math.pow(currPoint.Y - bottomPoint.Y, 2))) <= 2.5; - // if (isTopPoint || isRightPoint || isBottomPoint) { - // controlPoints.push({ X: data[i].X, Y: data[i].Y, I: i }); - // } - // } - // controlPoints.push({ X: data[0].X, Y: data[0].Y, I: 0 }); - // } else { for (let i = 0; i <= data.length - 4; i += 4) { controlPoints.push({ X: data[i].X, Y: data[i].Y, I: i }); controlPoints.push({ X: data[i + 3].X, Y: data[i + 3].Y, I: i + 3 }); } - // } } const addedPoints = this.props.addedPoints; + const [left, top, scaleX, scaleY, strokeWidth] = this.props.format; return ( <> |