app: fix cursor precision of various tools

Fix the cursor precision of the cage-transform, foreground-select,
n-point deformation, and warp-transform tools.
This commit is contained in:
Ell 2019-01-31 04:37:56 -05:00
parent 2c81d9cbcf
commit 158705e4ef
4 changed files with 18 additions and 1 deletions

View File

@ -196,6 +196,8 @@ gimp_cage_tool_init (GimpCageTool *self)
GIMP_DIRTY_SELECTION |
GIMP_DIRTY_ACTIVE_DRAWABLE);
gimp_tool_control_set_wants_click (tool->control, TRUE);
gimp_tool_control_set_precision (tool->control,
GIMP_CURSOR_PRECISION_SUBPIXEL);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_PERSPECTIVE);

View File

@ -240,7 +240,7 @@ gimp_foreground_select_tool_init (GimpForegroundSelectTool *fg_select)
GIMP_DIRTY_IMAGE_SIZE |
GIMP_DIRTY_ACTIVE_DRAWABLE);
gimp_tool_control_set_precision (tool->control,
GIMP_CURSOR_PRECISION_PIXEL_CENTER);
GIMP_CURSOR_PRECISION_SUBPIXEL);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_FREE_SELECT);
@ -973,6 +973,13 @@ gimp_foreground_select_tool_halt (GimpForegroundSelectTool *fg_select)
gimp_tool_control_set_toggled (tool->control, FALSE);
/* set precision to SUBPIXEL, because it may have been changed to
* PIXEL_CENTER if the tool has switched to MATTING_STATE_PAINT_TRIMAP,
* in gimp_foreground_select_tool_set_trimap().
*/
gimp_tool_control_set_precision (tool->control,
GIMP_CURSOR_PRECISION_SUBPIXEL);
fg_select->state = MATTING_STATE_FREE_SELECT;
/* update the undo actions / menu items */
@ -1040,6 +1047,10 @@ gimp_foreground_select_tool_set_trimap (GimpForegroundSelectTool *fg_select)
/* disable double click in paint trimap state */
gimp_tool_control_set_wants_double_click (tool->control, FALSE);
/* set precision to PIXEL_CENTER in paint trimap state */
gimp_tool_control_set_precision (tool->control,
GIMP_CURSOR_PRECISION_PIXEL_CENTER);
fg_select->state = MATTING_STATE_PAINT_TRIMAP;
gimp_foreground_select_tool_update_gui (fg_select);

View File

@ -188,6 +188,8 @@ gimp_n_point_deformation_tool_init (GimpNPointDeformationTool *npd_tool)
{
GimpTool *tool = GIMP_TOOL (npd_tool);
gimp_tool_control_set_precision (tool->control,
GIMP_CURSOR_PRECISION_SUBPIXEL);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_PERSPECTIVE);
gimp_tool_control_set_preserve (tool->control, FALSE);

View File

@ -201,6 +201,8 @@ gimp_warp_tool_init (GimpWarpTool *self)
gimp_tool_control_set_dirty_action (tool->control,
GIMP_TOOL_ACTION_COMMIT);
gimp_tool_control_set_wants_click (tool->control, TRUE);
gimp_tool_control_set_precision (tool->control,
GIMP_CURSOR_PRECISION_SUBPIXEL);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_WARP);
gimp_tool_control_set_action_size (tool->control,