This patch fixes or partially fixes Bugs 327319, 327318, 326952, 326933, 318885.
327319 Activating "Aspect Ratio" checkbox and changing the frame size should no longer crash Krita. (This was caused by an infinite recursion caused by the way the crop tool was validating size information)
327318 The "Decoration" combobox of the Crop Tool is now initialized properly
326952 Crop tool handles on the corners are locked under some circumstances. This is sort of fixed in that the gui no longer locks up because of an infinite loop. But there are situations when the handles are purposely disabled. For example if both height and width are fixed, or if the ratio and width are fixed then the rectangle is fully determined so dragging on the handles should not do anything. It is still possible to translate the selection by clicking inside.
326933 Now there is a checkbox that allows the user to specify if they want to limit the crop to the image. (So does not implement crop tool snapping to a canvas edge before user deliberately drag the handles outward.)
318885 Allow crop to center. This is fully implemented. The user can now drag a handle and resize the selection while keeping the selection centered. This is symmetric resizing.
In addition a new decoration type has been added called crosshair.
In summary two new checkboxes have been added. One that allows the user to either limit the crop to the current image size or grow the crop selection beyond the image boundaries. The second checkbox enables center growing / symmetric resizing of the crop bounds.
The way the limit growth of the selection to the picture is implemented does not preserve fixed values. This is because it simply validates the new calculated rectangle and if it is outside the image sets the bounds accordingly.
Snap to edges also needs to be figured out.
The ratio box recalculates as the user is typing. It should only calculate when the the box has lost focus or the user has pressed enter or the user presses one of increment buttons.
Created attachment 83539 [details]
crop tool patch
Created attachment 83540 [details]
patch #2 (use this patch instead)
Ok I figured out how to make the ratio text box behave. I just don't update the box with what the real ratio is except when triggered by typing in another box or moving a handle.
Git commit a67d11082a3196704b9322df86dbcc62fa0e394d by Boudewijn Rempt.
Committed on 13/11/2013 at 09:59.
Pushed by rempt into branch 'master'.
Various improvements to the crop tool
Related: bug 327319, bug 327318, bug 318885, bug 326952, bug 326933
Patch by Michael Martini. Thanks!
In addition a new decoration type has been added called crosshair. In
summary two new checkboxes have been added. One that allows the user to
either limit the crop to the current image size or grow the crop selection
beyond the image boundaries. The second checkbox enables center growing /
symmetric resizing of the crop bounds.
M +287 -124 krita/plugins/tools/tool_crop/kis_tool_crop.cc
M +14 -19 krita/plugins/tools/tool_crop/kis_tool_crop.h
M +46 -3 krita/plugins/tools/tool_crop/kistoolcropconfigwidget.cpp
M +7 -2 krita/plugins/tools/tool_crop/kistoolcropconfigwidget.h
M +25 -0 krita/plugins/tools/tool_crop/wdg_tool_crop.ui
The patch is pushed, so we can close the bug, I guess