aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/InkStrokeProperties.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-02-04 21:04:09 -0500
committerbobzel <zzzman@gmail.com>2023-02-04 21:04:09 -0500
commita8b19694ec902d4094914ba6ddd15e700fab117e (patch)
tree4dcf51726edd0ab72274cbb8c60ae92c3cd16635 /src/client/views/InkStrokeProperties.ts
parentc1e713b611f12b2070854e19e4838d6a44126c0b (diff)
image background color determines opacity of image (independently of annotations over image). enabled scrolling of images when in fitWidth mode. added disabling of text labels in ink shapes.
Diffstat (limited to 'src/client/views/InkStrokeProperties.ts')
-rw-r--r--src/client/views/InkStrokeProperties.ts11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/client/views/InkStrokeProperties.ts b/src/client/views/InkStrokeProperties.ts
index d19a916f9..1d8d52425 100644
--- a/src/client/views/InkStrokeProperties.ts
+++ b/src/client/views/InkStrokeProperties.ts
@@ -342,12 +342,19 @@ export class InkStrokeProperties {
if (ink) {
const screenDragPt = inkView.ComponentView?.ptToScreen?.(ink[controlIndex]);
if (screenDragPt) {
+ if (controlIndex === ink.length - 1) {
+ const firstPtScr = inkView.ComponentView?.ptToScreen?.(ink[0]);
+ if (firstPtScr && Math.sqrt((firstPtScr.X - screenDragPt.X) * (firstPtScr.X - screenDragPt.X) + (firstPtScr.Y - screenDragPt.Y) * (firstPtScr.Y - screenDragPt.Y)) < 7) {
+ const deltaX = ink[0].X - ink[controlIndex].X;
+ const deltaY = ink[0].Y - ink[controlIndex].Y;
+ return this.moveControlPtHandle(inkView, deltaX, deltaY, controlIndex, ink.slice());
+ }
+ }
const snapData = this.snapToAllCurves(screenDragPt, inkView, { nearestPt: { X: 0, Y: 0 }, distance: 10 }, ink, controlIndex);
if (snapData.distance < 10) {
const deltaX = snapData.nearestPt.X - ink[controlIndex].X;
const deltaY = snapData.nearestPt.Y - ink[controlIndex].Y;
- const res = this.moveControlPtHandle(inkView, deltaX, deltaY, controlIndex, ink.slice());
- return res;
+ return this.moveControlPtHandle(inkView, deltaX, deltaY, controlIndex, ink.slice());
}
}
}