app: simply pass through from the COMMIT to HALT action.
Improving previous commit. Rather than calling: > GIMP_TOOL_GET_CLASS (tool)->control (tool, GIMP_TOOL_ACTION_HALT, display) > gimp_tool_clear_status() ... in the COMMIT action, which is basically what the HALT action does, simply pass through from one case to the other. It also adds the call to gimp_tool_control_halt() which is most likely right anyway since we are halting the tool. This also makes the code consistent and any future changes to HALT case will be directly enabled after COMMIT.
This commit is contained in:
@ -672,23 +672,22 @@ gimp_tool_control (GimpTool *tool,
|
||||
}
|
||||
break;
|
||||
|
||||
case GIMP_TOOL_ACTION_HALT:
|
||||
case GIMP_TOOL_ACTION_COMMIT:
|
||||
GIMP_TOOL_GET_CLASS (tool)->control (tool, action, display);
|
||||
|
||||
if (gimp_tool_control_is_active (tool->control))
|
||||
gimp_tool_control_halt (tool->control);
|
||||
|
||||
gimp_tool_clear_status (tool);
|
||||
break;
|
||||
|
||||
case GIMP_TOOL_ACTION_COMMIT:
|
||||
/* always HALT after COMMIT here and not in each tool individually;
|
||||
* some tools interact with their subclasses (e.g. filter tool
|
||||
* and operation tool), and it's essential that COMMIT runs
|
||||
* through the entire class hierarchy before HALT
|
||||
*/
|
||||
action = GIMP_TOOL_ACTION_HALT;
|
||||
|
||||
/* pass through */
|
||||
case GIMP_TOOL_ACTION_HALT:
|
||||
GIMP_TOOL_GET_CLASS (tool)->control (tool, action, display);
|
||||
GIMP_TOOL_GET_CLASS (tool)->control (tool, GIMP_TOOL_ACTION_HALT, display);
|
||||
|
||||
if (gimp_tool_control_is_active (tool->control))
|
||||
gimp_tool_control_halt (tool->control);
|
||||
|
||||
gimp_tool_clear_status (tool);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user