diff options
author | bobzel <zzzman@gmail.com> | 2025-04-28 18:33:04 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2025-04-28 18:33:04 -0400 |
commit | a495e09b0926f3e5c69cc6ddcf92df613b8677e6 (patch) | |
tree | 412b6206c8173fea379ab8595c493fa42293bb62 /src | |
parent | efa1501b38aa71f306ae0717afc86f0803c71be2 (diff) |
fixed image cropping
Diffstat (limited to 'src')
-rw-r--r-- | src/client/views/nodes/ImageBox.tsx | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/client/views/nodes/ImageBox.tsx b/src/client/views/nodes/ImageBox.tsx index 004c2da44..010028af7 100644 --- a/src/client/views/nodes/ImageBox.tsx +++ b/src/client/views/nodes/ImageBox.tsx @@ -204,7 +204,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { drop = undoable( action((e: Event, de: DragManager.DropEvent) => { - if (de.complete.docDragData && this._props.rejectDrop?.(de, this.DocumentView?.())) { + if (de.complete.docDragData && !this._props.rejectDrop?.(de, this.DocumentView?.())) { let added: boolean | undefined; const hitDropTarget = (ele: HTMLElement, dropTarget: HTMLDivElement | null): boolean => { if (!ele) return false; @@ -298,7 +298,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { const anchy = NumCast(cropping.y); const anchw = NumCast(cropping._width); const anchh = NumCast(cropping._height); - const viewScale = NumCast(this.dataDoc[this.fieldKey + '_nativeHeight']) / anchh; + const viewScale = NumCast(this.dataDoc[this.fieldKey + '_nativeWidth']) / anchw; cropping.x = NumCast(this.Document.x) + NumCast(this.layoutDoc._width); cropping.y = NumCast(this.Document.y); cropping.onClick = undefined; @@ -726,7 +726,7 @@ export class ImageBox extends ViewBoxAnnotatableComponent<FieldViewProps>() { ref={action((r: HTMLImageElement | null) => (this.imageRef = r))} key="paths" src={srcpath} - style={{ transform, transformOrigin }} + style={{ transform, transformOrigin, height: 'fit-content' }} onError={action(e => (this._error = e.toString()))} draggable={false} width={nativeWidth} |