GNOME Bugzilla – Bug 753408
Dragging crop region from top right or top left does not keep aspect ratio if going out of image bounds
Last modified: 2021-05-19 14:44:25 UTC
Created attachment 308975 [details] 2x3 crop region Assume that you start a crop operation on an image, with a fixed aspect ratio for the crop. (First attached image.) Now resize the crop region by dragging the top left or top right corners, in such a way that the crop region dimensions exceed the page size. In this case the crop region no longer keeps the original aspect ratio. (Second attached image.) The culprit is the following code in src/editing_tools/EditingTools.vala: case BoxLocation.TOP_LEFT: if (get_constraint_aspect_ratio() == ANY_ASPECT_RATIO) { top = y; left = x; } else { if (y < eval_radial_line(center_x, center_y, left, top, x)) { top = y; float new_width = ((float) (bottom - top)) * get_constraint_aspect_ratio(); left = right - ((int) new_width); } else { left = x; float new_height = ((float) (right - left)) / get_constraint_aspect_ratio(); top = bottom - ((int) new_height); } } break; and case BoxLocation.TOP_RIGHT: if (get_constraint_aspect_ratio() == ANY_ASPECT_RATIO) { top = y; right = x; } else { if (y < eval_radial_line(center_x, center_y, right, top, x)) { top = y; float new_width = ((float) (bottom - top)) * get_constraint_aspect_ratio(); right = left + ((int) new_width); } else { right = x; float new_height = ((float) (right - left)) / get_constraint_aspect_ratio(); top = bottom - ((int) new_height); } } break; In both cases the condition is switched, it should be if (y >= eval_radial_line(...)). Resizing from any other edge of the crop box keeps the aspect ratio as it should.
Created attachment 308976 [details] 2x3 crop region resized
There is also some odd flickering going on when going outside the image
*** Bug 780798 has been marked as a duplicate of this bug. ***
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/shotwell/-/issues/4649.