aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/InkStrokeProperties.ts
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-12-14 09:59:12 -0500
committerbobzel <zzzman@gmail.com>2023-12-14 09:59:12 -0500
commitec578023e2147ff4f14724bb94cb47191076e793 (patch)
tree8d6b637aaa447ee1e440e33764983f2c872b1994 /src/client/views/InkStrokeProperties.ts
parentcebe9d2a567c20b99c8c394cfa598ee9d4d53ece (diff)
fixed lightbox view and multirow/col
Diffstat (limited to 'src/client/views/InkStrokeProperties.ts')
-rw-r--r--src/client/views/InkStrokeProperties.ts12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/client/views/InkStrokeProperties.ts b/src/client/views/InkStrokeProperties.ts
index 69c663a3e..a628c7120 100644
--- a/src/client/views/InkStrokeProperties.ts
+++ b/src/client/views/InkStrokeProperties.ts
@@ -1,5 +1,5 @@
import { Bezier } from 'bezier-js';
-import { action, makeObservable, observable, reaction } from 'mobx';
+import { action, makeObservable, observable, reaction, runInAction } from 'mobx';
import { Doc, NumListCast, Opt } from '../../fields/Doc';
import { InkData, InkField, InkTool, PointData } from '../../fields/InkField';
import { List } from '../../fields/List';
@@ -84,7 +84,6 @@ export class InkStrokeProperties {
* @param control The list of all control points of the ink.
*/
@undoBatch
- @action
addPoints = (inkView: DocumentView, t: number, i: number, controls: { X: number; Y: number }[]) => {
this.applyFunction(inkView, (view: DocumentView, ink: InkData) => {
const doc = view.Document;
@@ -95,7 +94,7 @@ export class InkStrokeProperties {
// Updating the indices of the control points whose handle tangency has been broken.
doc.brokenInkIndices = new List(Cast(doc.brokenInkIndices, listSpec('number'), []).map(control => (control > i ? control + 4 : control)));
- this._currentPoint = -1;
+ runInAction(() => (this._currentPoint = -1));
return controls;
});
@@ -155,7 +154,6 @@ export class InkStrokeProperties {
* Deletes the current control point of the selected ink instance.
*/
@undoBatch
- @action
deletePoints = (inkView: DocumentView, preserve: boolean) =>
this.applyFunction(
inkView,
@@ -188,7 +186,7 @@ export class InkStrokeProperties {
}
}
doc.brokenInkIndices = new List(brokenIndices.map(control => (control >= this._currentPoint ? control - 4 : control)));
- this._currentPoint = -1;
+ runInAction(() => (this._currentPoint = -1));
return newPoints.length < 4 ? undefined : newPoints;
},
true
@@ -201,7 +199,6 @@ export class InkStrokeProperties {
* @param scrpt The center point of the rotation in screen coordinates
*/
@undoBatch
- @action
rotateInk = (inkStrokes: DocumentView[], angle: number, scrpt: PointData) => {
this.applyFunction(inkStrokes, (view: DocumentView, ink: InkData, xScale: number, yScale: number, inkStrokeWidth: number) => {
const inkCenterPt = view.ComponentView?.ptFromScreen?.(scrpt);
@@ -223,7 +220,6 @@ export class InkStrokeProperties {
* @param scrpt The center point of the rotation in screen coordinates
*/
@undoBatch
- @action
stretchInk = (inkStrokes: DocumentView[], scaling: number, scrpt: PointData, scrVec: PointData, scaleUniformly: boolean) => {
this.applyFunction(inkStrokes, (view: DocumentView, ink: InkData) => {
const ptFromScreen = view.ComponentView?.ptFromScreen;
@@ -244,7 +240,6 @@ export class InkStrokeProperties {
* Handles the movement/scaling of a control point.
*/
@undoBatch
- @action
moveControlPtHandle = (inkView: DocumentView, deltaX: number, deltaY: number, controlIndex: number, origInk?: InkData) =>
this.applyFunction(inkView, (view: DocumentView, ink: InkData) => {
const order = controlIndex % 4;
@@ -457,7 +452,6 @@ export class InkStrokeProperties {
* Handles the movement/scaling of a handle point.
*/
@undoBatch
- @action
moveTangentHandle = (inkView: DocumentView, deltaX: number, deltaY: number, handleIndex: number, oppositeHandleIndex: number, controlIndex: number) =>
this.applyFunction(inkView, (view: DocumentView, ink: InkData) => {
const doc = view.Document;