Commit 3ed87015 authored by Michael Natterer's avatar Michael Natterer 😴

app: if there is no selection, don't cut/transform/paste in the transform tool

instead, take the easy path that simply calls gimp_item_transform()
and does exactly the same, just less weird.
parent bef6d571
......@@ -58,7 +58,6 @@ static void gimp_flip_tool_cursor_update (GimpTool *tool,
static TileManager * gimp_flip_tool_transform (GimpTransformTool *tool,
GimpItem *item,
gboolean mask_empty,
GimpDisplay *display);
......@@ -176,7 +175,6 @@ gimp_flip_tool_cursor_update (GimpTool *tool,
static TileManager *
gimp_flip_tool_transform (GimpTransformTool *trans_tool,
GimpItem *active_item,
gboolean mask_empty,
GimpDisplay *display)
{
GimpFlipOptions *options = GIMP_FLIP_TOOL_GET_OPTIONS (trans_tool);
......@@ -204,16 +202,6 @@ gimp_flip_tool_transform (GimpTransformTool *trans_tool,
gimp_item_linked_flip (active_item, context, options->flip_type, axis,
FALSE);
if (GIMP_IS_LAYER (active_item) &&
gimp_layer_get_mask (GIMP_LAYER (active_item)) &&
mask_empty)
{
GimpLayerMask *mask = gimp_layer_get_mask (GIMP_LAYER (active_item));
gimp_item_flip (GIMP_ITEM (mask), context,
options->flip_type, axis, FALSE);
}
if (trans_tool->original)
{
/* this happens when transforming a normal drawable or the
......
......@@ -124,7 +124,6 @@ static void gimp_transform_tool_dialog_update (GimpTransformTool
static TileManager *
gimp_transform_tool_real_transform (GimpTransformTool *tr_tool,
GimpItem *item,
gboolean mask_empty,
GimpDisplay *display);
static void gimp_transform_tool_halt (GimpTransformTool *tr_tool);
......@@ -1141,7 +1140,6 @@ gimp_transform_tool_dialog_update (GimpTransformTool *tr_tool)
static TileManager *
gimp_transform_tool_real_transform (GimpTransformTool *tr_tool,
GimpItem *active_item,
gboolean mask_empty,
GimpDisplay *display)
{
GimpTool *tool = GIMP_TOOL (tr_tool);
......@@ -1162,21 +1160,6 @@ gimp_transform_tool_real_transform (GimpTransformTool *tr_tool,
options->clip,
progress);
if (GIMP_IS_LAYER (active_item) &&
gimp_layer_get_mask (GIMP_LAYER (active_item)) &&
mask_empty)
{
GimpLayerMask *mask = gimp_layer_get_mask (GIMP_LAYER (active_item));
gimp_item_transform (GIMP_ITEM (mask), context,
&tr_tool->transform,
options->direction,
options->interpolation,
options->recursion_level,
options->clip,
progress);
}
if (tr_tool->original)
{
/* this happens when transforming a normal drawable or the
......@@ -1234,7 +1217,6 @@ gimp_transform_tool_transform (GimpTransformTool *tr_tool,
const gchar *null_message = NULL;
const gchar *locked_message = NULL;
gboolean new_layer;
gboolean mask_empty;
switch (options->type)
{
......@@ -1275,8 +1257,6 @@ gimp_transform_tool_transform (GimpTransformTool *tr_tool,
if (tr_tool->dialog)
gimp_dialog_factory_hide_dialog (tr_tool->dialog);
mask_empty = gimp_channel_is_empty (gimp_image_get_mask (image));
gimp_set_busy (display->gimp);
/* undraw the tool before we muck around with the transform matrix */
......@@ -1303,7 +1283,8 @@ gimp_transform_tool_transform (GimpTransformTool *tr_tool,
switch (options->type)
{
case GIMP_TRANSFORM_TYPE_LAYER:
if (! gimp_viewable_get_children (GIMP_VIEWABLE (tool->drawable)))
if (! gimp_viewable_get_children (GIMP_VIEWABLE (tool->drawable)) &&
! gimp_channel_is_empty (gimp_image_get_mask (image)))
tr_tool->original = gimp_drawable_transform_cut (tool->drawable,
context,
&new_layer);
......@@ -1322,7 +1303,6 @@ gimp_transform_tool_transform (GimpTransformTool *tr_tool,
*/
new_tiles = GIMP_TRANSFORM_TOOL_GET_CLASS (tr_tool)->transform (tr_tool,
active_item,
mask_empty,
display);
switch (options->type)
......
......@@ -117,7 +117,6 @@ struct _GimpTransformToolClass
GimpDisplay *display);
TileManager * (* transform) (GimpTransformTool *tool,
GimpItem *item,
gboolean mask_empty,
GimpDisplay *display);
};
......
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