Commit 786bfa51 authored by Ell's avatar Ell

app: in scale tool, scale around center even when using numeric input

In the scale tool, when the "around center" option is toggled,
scale the item around its center not only through canvas
interaction, but also when entering width/height values through the
tool GUI.
parent 255f2e1c
......@@ -371,8 +371,26 @@ gimp_scale_tool_size_notify (GtkWidget *box,
GimpTool *tool = GIMP_TOOL (tg_tool);
GimpTransformTool *tr_tool = GIMP_TRANSFORM_TOOL (tg_tool);
tg_tool->trans_info[X1] = tg_tool->trans_info[X0] + width;
tg_tool->trans_info[Y1] = tg_tool->trans_info[Y0] + height;
if (options->frompivot_scale)
{
gdouble center_x;
gdouble center_y;
center_x = (tg_tool->trans_info[X0] +
tg_tool->trans_info[X1]) / 2.0;
center_y = (tg_tool->trans_info[Y0] +
tg_tool->trans_info[Y1]) / 2.0;
tg_tool->trans_info[X0] = center_x - width / 2.0;
tg_tool->trans_info[Y0] = center_y - height / 2.0;
tg_tool->trans_info[X1] = center_x + width / 2.0;
tg_tool->trans_info[Y1] = center_y + height / 2.0;
}
else
{
tg_tool->trans_info[X1] = tg_tool->trans_info[X0] + width;
tg_tool->trans_info[Y1] = tg_tool->trans_info[Y0] + height;
}
gimp_transform_grid_tool_push_internal_undo (tg_tool);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment