app/tools: Use NDE filter's drawable for on-canvas transform grid

Resolves #12403
gimp_filter_tool_set_transform_grid () is used to draw the on-canvas
transform grid for filters. It always assumes that the tool's selected
layer should be used to define these boundaries.
With NDE filters, you might be editing a filter on a different layer than
the actively selected one. This patch checks if an existing filter is being
edited, and if so, we grab the drawable from the filter rather than from
the tool.
This commit is contained in:
Alx Sa 2024-11-18 15:02:47 +00:00
parent 8021b46414
commit a9056419ce
1 changed files with 16 additions and 9 deletions

View File

@ -29,6 +29,7 @@
#include "tools-types.h"
#include "core/gimpcontainer.h"
#include "core/gimpdrawablefilter.h"
#include "core/gimpitem.h"
#include "display/gimpdisplay.h"
@ -559,19 +560,25 @@ gimp_filter_tool_set_transform_grid (Controller *controller,
GeglRectangle *area,
const GimpMatrix3 *transform)
{
GimpTool *tool;
GimpDrawable *drawable;
gdouble x1 = area->x;
gdouble y1 = area->y;
gdouble x2 = area->x + area->width;
gdouble y2 = area->y + area->height;
GimpMatrix3 matrix;
GimpTool *tool;
GimpFilterTool *filter_tool;
GimpDrawable *drawable;
gdouble x1 = area->x;
gdouble y1 = area->y;
gdouble x2 = area->x + area->width;
gdouble y2 = area->y + area->height;
GimpMatrix3 matrix;
if (! controller->widget)
return;
tool = GIMP_TOOL (controller->filter_tool);
drawable = tool->drawables->data;
tool = GIMP_TOOL (controller->filter_tool);
filter_tool = controller->filter_tool;
if (filter_tool->existing_filter)
drawable = gimp_drawable_filter_get_drawable (filter_tool->existing_filter);
else
drawable = tool->drawables->data;
if (drawable)
{