aboutsummaryrefslogtreecommitdiff
path: root/src/client/views/DocumentDecorations.tsx
diff options
context:
space:
mode:
authorbobzel <zzzman@gmail.com>2023-12-29 01:01:55 -0500
committerbobzel <zzzman@gmail.com>2023-12-29 01:01:55 -0500
commit865478933af8166cb699cbe4a2653aa52423dedb (patch)
tree57dedd5dfe4349432a7c445f408f9e675f1f53df /src/client/views/DocumentDecorations.tsx
parentdf2fc3f11e3b474144db5062620c9f65ca857203 (diff)
fixed dropping images from web. fixed exif data on images and autorotating exif rotated images. fixed selecting on web pages, and resizing web pages upward so that pointer events aren't grabbed.
Diffstat (limited to 'src/client/views/DocumentDecorations.tsx')
-rw-r--r--src/client/views/DocumentDecorations.tsx12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 7003485d2..f3da133c3 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -310,7 +310,8 @@ export class DocumentDecorations extends ObservableReactComponent<DocumentDecora
*/
@action
onRadiusDown = (e: React.PointerEvent): void => {
- this._isRounding = DocumentView.Interacting = true;
+ SnappingManager.SetIsResizing(SelectionManager.Docs.lastElement());
+ this._isRounding = true;
this._resizeUndo = UndoManager.StartBatch('DocDecs set radius');
setupMoveUpEvents(
this,
@@ -327,7 +328,8 @@ export class DocumentDecorations extends ObservableReactComponent<DocumentDecora
return false;
},
action(e => {
- DocumentView.Interacting = this._isRounding = false;
+ SnappingManager.SetIsResizing(undefined);
+ this._isRounding = false;
this._resizeUndo?.end();
}), // upEvent
emptyFunction,
@@ -439,10 +441,9 @@ export class DocumentDecorations extends ObservableReactComponent<DocumentDecora
@action
onPointerDown = (e: React.PointerEvent): void => {
- SnappingManager.SetIsResizing(SelectionManager.Docs.lastElement());
+ SnappingManager.SetIsResizing(SelectionManager.Docs.lastElement()); // turns off pointer events on things like youtube videos and web pages so that dragging doesn't get "stuck" when cursor moves over them
setupMoveUpEvents(this, e, this.onPointerMove, this.onPointerUp, emptyFunction);
e.stopPropagation();
- DocumentView.Interacting = true; // turns off pointer events on things like youtube videos and web pages so that dragging doesn't get "stuck" when cursor moves over them
this._resizeHdlId = e.currentTarget.className;
const bounds = e.currentTarget.getBoundingClientRect();
this._offset = { x: this._resizeHdlId.toLowerCase().includes('left') ? bounds.right - e.clientX : bounds.left - e.clientX, y: this._resizeHdlId.toLowerCase().includes('top') ? bounds.bottom - e.clientY : bounds.top - e.clientY };
@@ -595,7 +596,6 @@ export class DocumentDecorations extends ObservableReactComponent<DocumentDecora
onPointerUp = (e: PointerEvent): void => {
SnappingManager.SetIsResizing(undefined);
SnappingManager.clearSnapLines();
- DocumentView.Interacting = false;
this._resizeHdlId = '';
this._resizeUndo?.end();
@@ -766,7 +766,7 @@ export class DocumentDecorations extends ObservableReactComponent<DocumentDecora
top: bounds.y - this._resizeBorderWidth / 2,
transformOrigin,
background: SnappingManager.ShiftKey ? undefined : 'yellow',
- pointerEvents: SnappingManager.ShiftKey || DocumentView.Interacting ? 'none' : 'all',
+ pointerEvents: SnappingManager.ShiftKey || SnappingManager.IsResizing ? 'none' : 'all',
display: SelectionManager.Views.length <= 1 || hideDecorations ? 'none' : undefined,
transform: `rotate(${rotation}deg)`,
}}