Bugfix in PreviewWindow (attempt to fix issue #3773)
This commit is contained in:
@@ -211,16 +211,15 @@ bool PreviewWindow::on_motion_notify_event (GdkEventMotion* event)
|
|||||||
int x, y, w, h;
|
int x, y, w, h;
|
||||||
getObservedFrameArea (x, y, w, h);
|
getObservedFrameArea (x, y, w, h);
|
||||||
if (x>imgX || y>imgY || w < imgW || h < imgH) {
|
if (x>imgX || y>imgY || w < imgW || h < imgH) {
|
||||||
bool inside = event->x > x - 6 && event->x < x + w - 1 + 6 && event->y > y - 6 && event->y < y + h - 1 + 6;
|
bool inside = event->x > x - 6 && event->x < x + w - 1 + 6 && event->y > y - 6 && event->y < y + h - 1 + 6;
|
||||||
bool moreInside = event->x > x + 6 && event->x < x + w - 1 - 6 && event->y > y + 6 && event->y < y + h - 1 - 6;
|
|
||||||
|
|
||||||
CursorShape newType = cursor_type;
|
CursorShape newType = cursor_type;
|
||||||
|
|
||||||
if (isMoving) {
|
if (isMoving) {
|
||||||
mainCropWin->remoteMove ((event->x - press_x) / zoom, (event->y - press_y) / zoom);
|
mainCropWin->remoteMove ((int)((event->x - (double)press_x) / zoom), (int)((event->y - (double)press_y) / zoom));
|
||||||
press_x = event->x;
|
press_x = event->x;
|
||||||
press_y = event->y;
|
press_y = event->y;
|
||||||
} else if (inside && !moreInside) {
|
} else if (inside) {
|
||||||
newType = CSClosedHand;
|
newType = CSClosedHand;
|
||||||
} else {
|
} else {
|
||||||
newType = CSArrow;
|
newType = CSArrow;
|
||||||
@@ -247,18 +246,10 @@ bool PreviewWindow::on_button_press_event (GdkEventButton* event)
|
|||||||
if (x>imgX || y>imgY || w < imgW || h < imgH) {
|
if (x>imgX || y>imgY || w < imgW || h < imgH) {
|
||||||
|
|
||||||
if (!isMoving) {
|
if (!isMoving) {
|
||||||
bool inside = event->x > x - 6 && event->x < x + w - 1 + 6 && event->y > y - 6 && event->y < y + h - 1 + 6;
|
|
||||||
bool moreInside = event->x > x + 6 && event->x < x + w - 1 - 6 && event->y > y + 6 && event->y < y + h - 1 - 6;
|
|
||||||
isMoving = true;
|
isMoving = true;
|
||||||
|
|
||||||
if (!inside || moreInside) {
|
press_x = event->x;
|
||||||
mainCropWin->remoteMove ((event->x - (x + w / 2)) / zoom, (event->y - (y + h / 2)) / zoom);
|
press_y = event->y;
|
||||||
press_x = x + w / 2;
|
|
||||||
press_y = y + h / 2;
|
|
||||||
} else {
|
|
||||||
press_x = event->x;
|
|
||||||
press_y = event->y;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cursor_type != CSClosedHand) {
|
if (cursor_type != CSClosedHand) {
|
||||||
cursor_type = CSClosedHand;
|
cursor_type = CSClosedHand;
|
||||||
|
Reference in New Issue
Block a user