GimpPaintCore operates indipendently of a display, and hence needs
to be explictly told when operating in "show all" mode, affecting
the result of paint tools operating in "sample merged" mode. Add
gimp_paint_core_set_show_all() for that purpose, and call it,
passing the current display's "show all" mode, in GimpPaintTool.
This controls which pickable (the image itself, or its projection)
is used as the sampling source, as per
GimpPaintCore::saved_proj_buffer, and as returned by the new
gimp_paint_core_get_image_pickable() function.
In the bucket-fill tool, allow using the tool outside the canvas
bounds with "sample merged" active in "fill similar colors" mode,
when the current display is in "show all" mode. Additionally,
ignore "sample merged" in "fill whole selection" mode, on which it
has no effect.
In the transform tools, when transforming the entire image in show-
all mode, don't crop the preview and the transform bounds to the
size of the canvas.
Add a show_all parameter to gimp_image_pick_color(), which, when
TRUE, allows picking colors outside the canvas bounds in sample-
merged mode. Forward the display's "show all" mode through this
parameter where applicable (in particular, in the color-picker tool
and the pointer dockable).
... to avoid unnecessarily updating their previews while dragging,
and, in particular, to avoid updating the image's GimpImageViewable
size in show-all mode.
... which specifies whether to clip the viewport to the canvas
(previously, it would always be clipped). Use the appropriate
value in all callers, depending on the shell's "show all" mode. In
particular, this commit avoids clipping the image projection's
priority rect to the canvas in "show all" mode.
Fixes the error:
> Critical error: gimp_line_art_thaw: assertion 'line_art->priv->frozen'
This may happen in cases when we didn't actually freeze the line art at
pointer click, because we were in an invalid case (for instance,
clicking out of selection), hence we must not thaw the line art either
at button release.
... which temporarily changes the transform-type of the tool,
restoring the original type once it's halted. To be used when
activating a transform tool through an action for a specific
transform type.
Add a new "Image" transform type to the transform tools, in
addition to the existing "Layer", "Selection", and "Path" transform
types. The "Image" mode transforms the entire image, rather than a
single item. In tools with a preview, the preview shows the
transformed image projection. The clipping mode controls how the
canvas is clipped during the transform; in particular, the ADJUST
clipping mode resizes the canvas to fit its transformed size.
In GimpCanvasTransformPreview, use a GimpPickable, instead of a
GimpDrawable, as the preview source, so that we can use it with the
image projection, rather than just with drawables.
Remove the special clipping-mode handling for channels throughout
the transform (and drawable-filter) code, and rather use
gimp_item_get_clip(), added in the previous commit, instead. As
mentioned in the previous commit, we only modify the clipping mode
in top-level code, while having lower-level code use the clipping
mode as-is. This not only hides the actual clipping-mode logic
from the transform code, but, in particular, allows code performing
transformation internally to use arbitrary clipping modes.
Also, this commit fixes a bunch of PDB bugs all over the place :)
In GimpFilterTool, add a new "clipping" option, which can be either
Adjust or Clip. This option is controllable for layers, when
there's no selection mask.
When set to Adjust, which is used by default, the filter's output
may extent past the drawable's boundary, and the drawable will be
resized to match the output when committed.
which means that it's now included normally via gimpbase.h
and not any longer via gimpbasetypes.h which we only did out
of lazyness. A *lot* of files in libgimp* and app/ now need to
GIMP_BUTTON_PRESS_DOUBLE press event would be called before the second
release event happens hence the tool control would not be properly
halted. Just pass through the gimp_selection_tool_start_edit() check for
any press events other than GIMP_BUTTON_PRESS_NORMAL.
Step one: get rid of all those deprecation warnings that make
it hard to see any other warnings:
- add a lot of dummy API to GimpAction, GimpActionGroup, GimpUIManager
etc. which simply forwards to the deprecated GTK functions, they
will all go away again later
- rename GimpAction to GimpActionImpl
- add interface GimpAction that is implemented by all action classes,
creates a common interface and allows to remove some duplicated
logic from GimpToggleAction and GimpRadioAction, and at the same
time adds more features
...gimp_size_entry_set_resolution: assertion 'GIMP_IS_SIZE_ENTRY (gse)'
failed
In gimp_tool_options_manager_tool_changed() make sure the new tool's
tool options GUI always exists, so tools can access it even if the
tool options dockable is not currently open.
Don't clear the preset combo right after a preset was selected.
Instead, clear it as soon as any change is made to the settings in the
dialog. This way the last chosen preset's name stays in the combo as
long as the current settings are identical to the preset.
This commit adds a new preview called "Grayscale", allowing to see the
resulting mask in black and white. The previous preview is now called
"On color" and allow users to choose the color and opacity, instead of
imposing only 4 colors (red, green, blue, grey).
When using a selection modifier Altr+Ctrl|Shift, we want to commit the
selection. If I do it too late though, and if the polygon was not closed
yet, the computed coordinates for the floating selection end up (0, 0)
because it is based on the selection coordinates (yet an unclosed
polygon does not create a selection yet). So commit the tool from within
GimpSelectionTool instead, as soon as we confirmed that the class is
going to take over with SELECTION_MOVE or SELECTION_MOVE_COPY.
Note: ability of quick copying|cuting an unclosed polygon is very useful
as it removes the additional step for a case where anyway committing the
selection was a prerequisite.
... selection is committed;
Fast copy|cut-paste modifiers in selection tools were not working with
the Free Select tool, even when the polygon was closed. The reason was
that GimpPolygonSelectTool was not properly chaining up with the parent
implementation for oper_update(), and then upon a button press, we need
to check to call gimp_selection_tool_start_edit() to see if the action
should not be handled by GimpSelectionTool.
Of course, since we don't necessarily want all child class of
GimpPolygonSelectTool to support these modifiers (typically we may not
want these in the Foreground select tool), I set allow_move to FALSE,
then set it to TRUE only in the GimpFreeSelectTool subclass.
Add a new GimpFilterTool::region_changed() virtual function, which
gets called whenever the filter region changes, either due to a
change to the tool's "region" option, or a change to the image
mask.
Override GimpFilterTool::region_changed() in GimpOperationTool and
GimpOffsetTool, instead of listening to a change to the "region"
option in GimpTool::options_notify(), so that the tools are
properly updated when the image mask changes.
Add a new Offset filter tool, as a front-end to gimp:offset. The
tool replaces, and provides the same interface as, the drawable-
offset dialog, while also providing live preview and on-canvas
interaction.
Note that we don't simply use a custom propgui constructor for
gimp:offset, since we need a little more control.
Make sure to update the drawable after committing the Warp tool, if
high-quality-preview is disabled, and we use a non-nearest sampler.
Necessary after commit d928a80b7f.
...even when not supposed to
Don't use gimp_config_copy() to set the tool options from the ones
stored in the preset. Instead, add utility function
tool_manager_copy_tool_options() that only copies properties of
GimpToolOptions and its subclasses.
Simply set the tool, copy the tool options' context properties, then
copy the tool options' own properties and done. Much more obvious and
works.
This commit adds support for moving together an intersecting pair
of guides using the Move tool, by dragging the guides at their
point of intersection. This is useful when the guides are used to
mark a point, rather than a pair of lines (e.g., as is the case for
the mandala symmetry guides, which mark the symmetry's point of
origin).
Add gimp_image_pick_guides(), which can return a set of guides,
rather than a single guide. The API allows an arbitrary set of
guides to be returned, but, in practice, at most two intersecting
guides are returned, as per the above.
In GimpMoveTool and GimpGuideTool, add support for moving multiple
guides together, and, in GimpMoveTool, use gimp_image_pick_guides()
to potentially pick multiple guides.
...when overwriting existing text
gimp_text_tool_enter_text(): when replacing a selection, use the text
properties from the text style editor for the entered text, otherwise
the style of the text before the selection will be used.
In GimpFilterTool, properly clean up the controller's widget weak-
pointer and signal-handlers upon destruction, to avoid invalid
memory access when the widget is destroyed, if the widget outlives
the controller.
In GimpFreeSelectTool, flush the image when committing the tool, if
the seletion is created at the time of the commit (i.e., if the
polygon is not closed prior to the commit).
In gimp_selection_tool_start_change(), increase the priority of the
idle source used for hiding the selection so that it's run before
the canvas is redrawn, to avoid flickering the previous selection.