Commit Graph

3177 Commits

Author SHA1 Message Date
a3fead4bbd New upstream version 2.10.14 2019-11-09 19:05:21 -05:00
Ell
e79d852d3a app: (re-)add GimpDisplayShell::show-all property
... which corresponds to the shell's show-all mode.  We'll listen
to its "notify" signal in the bucket-fill tool.

(cherry picked from commit 02654b0ac0)
2019-11-04 13:33:47 +02:00
Ell
d1324ad802 app: rename GimpImageViewable to GimpImageProxy
We're going to have GimpImageProxy implement GimpPickable, so that
it can be used as either a viewable or a pickable proxy for an
image.

(cherry picked from commit 8d8cc12f40)
2019-11-04 13:33:47 +02:00
f4c87c048e app: fix typo in gimptoolrectangle.c 2019-10-27 16:57:21 +01:00
b4569d3b18 New upstream version 2.10.12 2019-10-13 20:52:44 -04:00
dfda00d5f7 app: fix "Result is not floating-point (UNINTENDED_INTEGER_DIVISION)".
See #3996.
This was a warning raised by the Coverity scan on one of the lines. I
fix also in the same time other arithmetics mixing int and double.
Better be thorough.
The specific warning was on:
> circ = 2.0 * G_PI * (private->width / 2)
where the division was integer, which was probably not intended. Of
course that error (display item only) was likely barely visible anyway,
still…

(cherry picked from commit c809e221ec)
2019-10-12 17:09:57 +02:00
Ell
b67efd4b6c app: add gimp_display_shell_get_canvas_pickable()
... which is similar to gimp_display_shell_get_pickable(), however,
it returns the projection, rather than the image, only when
gimp_display_shell_get_infinite_canvas() is TRUE, i.e., when the
shell is in "show all" mode *and* canvas padding is disabled.

(cherry picked from commit 71f42f6675)
2019-09-19 20:24:49 +03:00
Ell
dcfbc877ac app: behave as if "show all" is disabled in GimpCanvasPassePartout when keeping padding 2019-09-15 16:41:36 +03:00
Ell
be2c6d139f app: behave as if "show all" is disabled in GimpCanvasGrid when keeping padding 2019-09-15 16:41:36 +03:00
Ell
f5fab1daa6 app: behave as if "show all" is disabled in the navigation dockable when keeping padding 2019-09-15 16:41:36 +03:00
Ell
6088a747c0 app: behave as if "show all" is disabled in edit/buffers/DnD actions when keeping padding 2019-09-15 16:41:35 +03:00
Ell
f7582614f4 app: behave as if "show all" is disabled in scroll/zoom actions when keeping padding 2019-09-15 16:41:35 +03:00
Ell
c8df81692c app: add option to keep canvas padding in "show all" mode
Add an option to keep the normal canvas padding in "show all" mode,
instead of extending the checkerboard pattern indefinitely.  This
is useful when wanting to show the image content beyond the canvas,
while still keeping the focus on the canvas; further commits will
extend this mode to behave in more view-related cases as if "show
all" wasn't enabled.

Add a new 'View -> Padding Color -> Keep Padding in "Show All"
Mode" toggle, which controls this behavior, with a corresponding
default-value option in the preferences, under "Image Windows ->
Appearance".
2019-09-15 16:41:35 +03:00
Ell
10b05d42df app: fix CRITICAL in GimpNavigationEditor
... after commit 2c9a8a567b.  Don't
use the same function as a handler for GimpContext::display-changed
and GimpContext::image-changed -- their signatures are different.

(cherry picked from commit 1b3c1fb9cb)
2019-09-10 17:56:03 +03:00
Ell
0b6c63c0cc app: clear navigation editor when last image is closed
In GimpNavigationEditor, make sure to clear the editor's shell when
the last image is closed, even though the corresponding display is
stil alive, so that we don't needlessly extend the lifetime of the
image.  This is necessary after the recent GimpImageViewable
changes, since the editor now (indirectly) holds a reference on the
image.

(cherry picked from commit 2c9a8a567b)
2019-09-10 15:16:13 +03:00
Ell
668d8b2ee1 app: update image-projection priority rect when switching displays
Update the image-projection priority rect to the current display's
viewport when the display becomes active, so that the right region
is rendered first when switching between different displays of the
same image.

(cherry picked from commit 582930aa61)
2019-09-05 13:56:46 +03:00
Ell
2038de0dc2 app: various fixes in gimp_display_shell_set_show_all()
(cherry picked from commit 19817877a5)
2019-09-05 13:20:00 +03:00
Ell
5b428a115d app: add support for show-all mode in GimpCanvasPassePartout
Don't clip the outer rect to the size of the canvas in show-all
mode.
2019-09-04 20:56:24 +03:00
Ell
f5ffc7d831 app: add support for show-all mode in GimpCanvasGrid
Don't crop the grid to the canvas size in show-all mode.
2019-09-04 20:56:24 +03:00
Ell
a0bdb2541d app: add gimp_canvas_item_untransform_viewport()
... which untransforms the viewport from display space to the
item's coordinate space (i.e., scaled and translated image space).
2019-09-04 20:56:24 +03:00
Ell
5e59e5c002 app: add support for color picking in "show all" mode
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).
2019-09-04 20:56:24 +03:00
Ell
06018d766f app: fix out-of-bounds rendering when alpha channel is invisible
When the image's alpha channel is invisible, paint regions outside
the image contents as black, instead of using a checkboard pattern.
This is especially notable when viewing the image in "show all"
mode.
2019-09-04 20:56:24 +03:00
Ell
4eef2297b6 app: show full image contents in GimpNavigationEditor
In GimpNavigation{Editor,View}, show the full image contents when
the corresponding display is in "show all" mode.  Additionally,
when the display's "show canvas boundary" is active, show the
canvas boundary in the navigation view as well.
2019-09-04 20:56:23 +03:00
Ell
214cda5403 app, menus: add "show canvas boundary" display option
Add a "show canvas boundary" display option, and a corresponding
"View" menu item and default-apperance preferences option.  When
enabled (the default), the canvas boundary is shown as an orange/
black dashed line in "show all" mode.
2019-09-04 20:56:23 +03:00
Ell
f0b7d0a2e2 app: improve display scroll/zoom-related behavior in "show all" mode
In "show all" mode, the image is thought to be "infinite"; this
commit improves the overall scrolling/zooming behavior in this mode
according to this assumption.  In cases where a specific image size
is needed (e.g., for the scrollbar bounds, fit-image-in-window,
etc.), the image's full bounding box is used; however, in cases
where a center point is needed (e.g., for the zoomed-out scrollbar
bounds, center-image-in-window), the canvas center, rather than the
bounding-box center, is still used.
2019-09-04 20:56:23 +03:00
Ell
1f76013d1e app: add "clip" parameter to gimp_display_shell_untransform_viewport()
... 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.
2019-09-04 20:56:23 +03:00
Ell
162665e42b app, menus: add "show all" mode to GimpDisplayShell; "View -> Show All" toggle
Add a "show all" mode to GimpDisplayShell, controlled through a
corresponding "View -> Show All" menu item.  When enabled, the
entire image content is displayed, instead of cropping the image
to the canvas size.  More generally, the display behaves as if the
canvas were infinite.  The following commits improve the overall
behavior in this mode.

Add a prefernces option to control the default "show all" state.
2019-09-04 20:56:23 +03:00
Ell
3675916880 app: use a pickable instead of a drawable in GimpCanvasTransformPreview
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.

(cherry picked from commit 6023f97509)
2019-08-11 00:30:16 +03:00
Ell
e5d1f5ac4b app: add gimp_display_shell_show_image()
... which controls whether or not the image is rendered by the
shell.  We'll use this to hide the image while showing its
transform preview in the next commits.

(cherry picked from commit 539d666ae2)
2019-08-11 00:30:14 +03:00
9f529d6164 app: make sure the display is not rotated by a very small angle
gimp_display_shell_rotate_update_transform(): reliably set rotation to
0.0 using an epsilon of 1e-3.

(cherry picked from commit 7ddf40b78b)
2019-07-25 12:50:37 +02:00
adf308d10e app: remove gimp_display_shell_filter_new(), it's empty and useless
(cherry picked from commit ec18b969a3)
2019-07-25 10:02:16 +02:00
417d0dccd7 app: start porting away from GtkAction and friends
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

(cherry picked from commit 86e07c16b5)

Merged to gimp-2-10 to keep the diff to master as small as possible
2019-07-02 14:57:45 +02:00
ef6bb9d4ad Issue #2643 - Conversion to grayscale fails with artifacts
Connect GimpDisplayShell to GimpImage::mode-changed and update its
cached color transforms. Also get rid of a duplicate conection to
GimpImage::precision-changed.

(cherry picked from commit a1aa179436)

No idea why the artifacty never appeared on 2.10, the code was just as
broken as in master...
2019-06-01 14:27:00 +02:00
de568a0f61 app: use g_clear_pointer() in more places
(cherry picked from commit 901350ba20)
2019-05-27 17:51:14 +02:00
ce92efa82e Add a few more misc. source comment typos
(cherry picked from commit 1c91b8d97e)
2019-05-10 01:42:22 +09:00
Ell
aa9d16a822 Issue #3306 - Memory leak using Crop tool
In gimp_canvas_passe_partout_get_extents(), free the inner region
after XORing it with the outer region.

(cherry picked from commit 84e183e5ed)
2019-04-30 16:47:08 -04:00
Ell
67f44f3e34 app: add GimpToolPolygon::change-complete signal
... which is emitted when finishing a change to the polygon,
similarly to GimpToolRectangle::change-complete.

(cherry picked from commit 134ff92fe0)
2019-04-25 06:10:25 -04:00
Ell
c161b0cccb app: add gimp_tool_polygon_is_closed()
(cherry picked from commit f84f1d89dc)
2019-04-25 06:10:24 -04:00
Ell
7d4ea79a98 app: allow passing NULL pointers to gimp_tool_polygon_get_points()
(cherry picked from commit e8c915af93)
2019-04-25 06:10:23 -04:00
Ell
fb1e552acd app: remove unused field from GimpPolygonSelectToolPrivate
(cherry picked from commit eda421e852)
2019-04-25 06:10:23 -04:00
Ell
1cdd32955e app: fix image-window UI-manager update while a projection is being rendered
Set the priority of the image window's UI-manager update idle
slightly higher than the projection idle priority, so that the
image actions are updated during projection rendering.

(cherry picked from commit 50aaeef6a0)
2019-03-30 19:31:26 -04:00
Ell
9c9467e076 Issue #2090 - Crash when using transform tools
In GimpTransformGridTool, avoid producing non-finite coordinate
and angle values.  In particular, this fixes a crash in
gimp_transform_grid_tool_get_cursor() as a result of a NaN angle
value being converted to a negative integer, hitting an assert.

(cherry picked from commit be7906c05c)
2019-03-30 11:18:06 -04:00
Ell
f19ebb6269 app: revert combo-box drop-down changes
Revert the use of gtk_combo_box_set_wrap_width() to change the
combo-box drop-down style, except for the status-bar unit combo.
See https://gitlab.gnome.org/GNOME/gimp/issues/2828#note_421312 for
the rationale.

This reverts commits 1d984542e9,
68a33ab5bd, and
6dfca83c2a.

(cherry picked from commit 846d242f30)
2019-03-27 20:14:45 -04:00
Ell
f6229c921a app: in gimp_tool_gui_set_response_sensitive(), allow non-existent ID
In gimp_tool_gui_set_response_sensitive(), silently ignore non-
existent response IDs, instead of emitting a CRITICAL, to match the
behavior of GtkDialog and GimpOverlayDialog.  This simplifies code
with optional dialog responses.

(cherry picked from commit 92216a635a)
2019-03-13 05:28:36 -04:00
Ell
2dad85b84f libgimpwidgets, app, plug-ins: use GimpSpinButton everywhere
Replace all direct uses of GtkSpinButton with GimpSpinButton, so
that its modified behavior extends to all our spin buttons.
2019-03-09 07:43:13 -05:00
Ell
1ecbb94b2c app: take transform-grid handle size into account when readjusting
In the unified-transform, scale, and perspective tools, take the
maximal transform-grid handle size into account when readjusting
the transform, so that the handles themselves are fully within view
under arbitrary rotation, rather than just the corners.

(cherry picked from commit 46e16e175c)
2019-03-08 12:11:20 -05:00
Ell
21f76df21b app: fix unused variable warning in gimp_tool_gui_new()
... due to commit b23fae86f0.

(cherry picked from commit 7fb1d05ca4)
2019-03-07 16:49:03 -05:00
Ell
8d20b7c665 app: add gimp_tool_gui_add_button()
In GimpToolGui, add gimp_tool_gui_add_button() and
gimp_tool_gui_add_buttons_valist(), which allow adding dialog
buttons after construction.

(cherry picked from commit b23fae86f0)
2019-03-07 16:27:27 -05:00
Ell
41790aef4b app: fix transform-grid center point for non-affine transforms; use as pivot
In GimpToolTransformGrid, use the transformed center-point of the
original polygon as the position of the center-point handle, and as
a snapping point for the pivot when "cornersnap" is TRUE, instead
of using the center-point of the transformed polygon.  These two
points are different for non-affine transformations.

Furthermore, when "use-pivot-handle" is FALSE, use the center-
point as the reference point when transforming around the pivot,
instead of the pivot itself, which might not be set.  In
particular, this fixes transformation around the pivot in the
perspective tool.

Don't explicitly set the center-point as the pivot in the scale
tool, since this commit makes it unnecessary.

(cherry picked from commit cdc5782b3c)
2019-02-28 15:46:48 -05:00
Ell
b820d50827 app: add GimpToolCompass::effective-orientation property
In GimpToolCompass, add a read-only "effective-orientation"
property, which returns the actual orientation of the compass; in
particular, if the "orientation" property is set to AUTO,
"effective-orientation" returns HORIZONTAL or VERTICAL, depending
on the current compass direction.  In 3-point mode, the property
always returns AUTO.

(cherry picked from commit 40c0913178)
2019-02-04 16:48:55 -05:00