forked from Public/pics
Crop editor: do not allow selections starting outside image bounds.
This commit is contained in:
parent
d562c70667
commit
8147e2b97d
@ -224,9 +224,18 @@ class CropEditor {
|
|||||||
if (this.isMoving) {
|
if (this.isMoving) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let dragStartX = event.x - this.image_container.offsetLeft;
|
||||||
|
let dragStartY = event.y - this.image_container.offsetTop;
|
||||||
|
|
||||||
|
if (dragStartX > this.original_image.clientWidth ||
|
||||||
|
dragStartY > this.original_image.clientHeight) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.isDragging = true;
|
this.isDragging = true;
|
||||||
this.dragStartX = event.x - this.image_container.offsetLeft;
|
this.dragStartX = dragStartX;
|
||||||
this.dragStartY = event.y - this.image_container.offsetTop;
|
this.dragStartY = dragStartY;
|
||||||
}
|
}
|
||||||
|
|
||||||
cropSelectionEnd(event) {
|
cropSelectionEnd(event) {
|
||||||
|
Loading…
Reference in New Issue
Block a user