-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Discovered that when the cropper is implemented in a modal, that the coordinates retrieved from event.getRelativeX(this._container.getElement()), event.getRelativeY(this._container.getElement()) are not valid. The coordinates appear to retrieve the coordinate of the mouse within the window.
I was able to resolve this by changing the coordinates used to event.getClientX() and event.getClientY(), then adjusting the coordinates to be relative to _container.getAbsoluteTop(), and _container.getAbsoluteLeft();
While I know this is a working fix for my situation, I have not verified that this change would adversely affect other implementations.
public void onMouseMove(MouseMoveEvent event) {
if (this.isDown) {
int cX = event.getClientX();
int cY = event.getClientY();
int cT = this._container.getAbsoluteTop();
int cL = this._container.getAbsoluteLeft();
int x = cX - cL;
int y = cY - cT;
this.provideDragging(x,y);
this.updatePreviewWidget();
}
}
w32blaster
Metadata
Metadata
Assignees
Labels
No labels