Commit Graph

341 Commits

Author SHA1 Message Date
bd9e59a9f0 app: add "title", "icon_name" and "help_id" to gimp_tool_gui_new()
so things are the same at the API and the inside, which makes
GimpImageMapTool's use of GimpToolGui a little more obvious.
2016-01-22 23:41:45 +01:00
37de341099 Bug 759194 - Unified Transform Tool fails when layer is hidden
For the lack of a proper transform preview, add a HACK that allows to
make the transformed layer invisible while the tool is active.
2016-01-04 19:37:14 +01:00
e90e90265b app: port everything from gimp_channel_bounds() to gimp_item_bounds()
except gimpchannel.c itself.
2015-07-03 19:38:08 +02:00
25a696c7f8 Bug 735906 - Transform tools give unexpected results when transforming...
...certain sets of linked layers

Fix this bug for flip, rotate and general transforms (not for move yet):

gimp_item_linked_flip,rotate,transform(): always transform the passed
item too (do not filter it out of the list of items), so these functions
do the entire job of transforming a linked group now. Transforming the
active item separately didn't work (and is not implementable) if both
a layer and its parent layer group were linked.

flip tool, transform tool, layer->transform callbacks: don't call
gimp_item_foo() *and* (if the item is linked) gimp_item_linked_foo().
Instead call gimp_item_linked_foo() if the item is linked, and
gimp_item_foo() otherwise.

This commit also kills the mis-feature of transforming the selected
pixels of the active layer, and then the linked items completely. We
now either only transform the selected area *or* the linked group.
2015-06-25 12:25:41 +02:00
93414342c3 Bug 748762 - GIMP crashes when a selection is outside a layer boundary...
...and % is selected in rotate Tool

Refuse to start any transform tool (with an error message) if the
selection doesn't intersect with the layer.
2015-05-02 00:00:39 -04:00
36ca4d03f1 app: some cleanup in GimpTransformTool and subclasses
- formatting
- rename some GimpTransformTool members
- add member "does_persoective" and don't include subclasses
- handle drawing cleanup
2015-03-23 23:18:28 +01:00
2989bad35a Bug 721009 - new transform tool with freely placeable handles
Add new tool GimpHandleTransformTool which allows to freely place up
to 4 handles on the image, then move any one of them, which transforms
the image so that the remaining handles keep their position.

Did quite some cleanup on the code before pushing --Mitch
2015-03-05 12:36:59 +01:00
d36b18d7dc fix typo on commit 5ae6c8b1b3 2014-11-27 15:44:58 +01:00
5ae6c8b1b3 Bug 740778 - fix transformtools
Do not enable transform tools in selection mode when no selection exists.
2014-11-27 08:30:56 +01:00
a6601d563b app: some GimpProgress cleanup
- change start() and set_text() to use "format" and "..." instead of
  "message", allowing to format progress messages in place
- s/cancelable/cancellable/
- move "cancellable" to be the second argument of start()
2014-07-12 23:45:20 +02:00
cd479ce04e app: add an "auto overlay" API to GimpToolGui
which makes tool dialogs auto-overlay if the canvas is large
enough. Set all tools dialogs except GimpImageMapTool's dialog to
auto.
2014-06-09 03:08:43 +02:00
23037b5230 app: convert all stock IDs kept around by the core by icon names
Particularly GimpViewable's stock_id. Make sure old config files
containing stock IDs are still properly parsed.
2014-05-07 01:01:56 +02:00
843866e7e7 app: make things behave more reasonable with multiple monitors
There is now a preference option that determines whether windows
should be opened on the same monitor as before. It should be disabled
when the machine gets monitors plugged/unplugged dynamically ("laptop")
and enabled when there is a static multi-monitor setup ("wokstation").
This is merely the current simplistic policy on top of the newly added
underlying infrastructure:

- pass integer monitor numbers around in all places where we already
  pass around a GdkScreen. Pass the "current" monitor to these changed
  APIs, where "current" is either the monitor where the action-triggering
  widget is, or if that is unavailable the monitor where the mouse is.

- add gimp_widget_get_monitor() in order to easily get to the monitor,
  just like gtk_widget_get_screen().

- add screen and monitor parameters in some places that were missed
  before.

- in sessionrc, save all window positions relative to the window's
  monitor, and save the monitor separately, if it's not the screen's
  primary monitor.

- when restoring window positions, use the stored monitor when the new
  prefs options says so (use the screen's primary monitor if there is
  no stored monitor), otherwise use current monitor that is now passed
  around.
2014-05-02 03:01:23 +02:00
0bdb74710a app: rename the value-1...value-4 actions to opacity, size, aspect, angle 2014-04-19 20:09:39 +02:00
df8a148db0 app: make the transform tool's undo functions static 2014-04-18 23:03:22 +02:00
88e4d7e468 app: commit ongoing tool operations on tool change instead of cancelling
On tool change, we used to simply halt tools before switching to the
new one, which meant losing ongoing live-previewed tool changes, like
transforms, warps and color corrections. This change makes them being
applied to the image instead before switching to the new tool:

Add enum value GIMP_TOOL_ACTION_COMMIT that is passed to
GimpTool::control() before tool switching. Handle the new enum value
in all tools, and actually commit the previewed stuff. This changes
the behavior of GimpCageTool, GimpImageMapTool, GimpTransformTool and
GimpWarpTool.
2014-04-04 22:34:26 +02:00
b13c68fda6 Bug 701159 - Wrong name in transform tool dialogs...
...when acting on a path or selection

Factor out the code that checks if an active item exists and if it's
transformable (not locked etc.) and use that function in more places.
This fixes both the wrong dialog labels and the tool running into
broken states when the selection or a path are being transformed.
2014-02-05 00:57:28 +01:00
1335bc42c8 app: halt the transform tool when switching layer|selection|path transform 2014-02-04 23:28:59 +01:00
5054241ca6 Bug 722034 - Incorrect snapping behaviour for scale tool
Always snap to the center of transform tool handles.
2014-01-29 23:40:35 +01:00
df21310b0f app: properly initialize variables 2013-06-23 01:41:50 +02:00
90797f0927 app: add an embedding toggling test button to the transform dialogs 2013-06-08 01:33:35 +02:00
ad8d12ed69 app: add "response" signal to GimpToolGui
and connect to it instead of to gimp_tool_gui_get_dialog()'s signal.
One more step towards on-the-fly embedding/detaching.
2013-06-07 23:45:11 +02:00
9a811d276e app: add gimp_tool_gui_set_alternative_button_order() and use it
Also make some of GimpToolGui's memory management proper, there was
no leak but it needs to be proper in order to add runtime switching
between dialog and overlay.
2013-06-07 15:18:24 +02:00
88387d6e8d app: remove the "shell" parameter from gimp_tool_dialog_new() and gui_new() 2013-06-07 12:19:42 +02:00
1c20940f82 app: use a GimpToolGui in GimpTransformTool 2013-06-07 11:52:48 +02:00
785436f32e app: don't crash the flip tool on each click
Don't push an internal transform tool undo after invoking the flip
special case of directly transforming on each click, because the
transform clears the tool state and there is nothing to undo anyway
(flip is atomic). Additionally, add a precondition check to
gimp_transform_tool_push_internal_undo().
2013-06-06 02:08:00 +02:00
3b68ae0f3c app, pdb, libgimp: Remove all traces of the supersampling recursion level
from all transform APIs. This is no longer used since we use GEGL to
transform, the value was only passed around and never used.
2013-05-31 01:15:32 +02:00
0a31b29b9a app: transform_tool - don't flush the image when display is NULL
it means the dialog is being deleted
2013-05-29 20:10:33 +02:00
e3ef19ec89 app: don't gimp_display_get_image(NULL) in gimp_transform_tool_response() 2013-05-29 19:41:54 +02:00
fdfa2c782d app: integrate transform tool undo with normal image undo
Also clean up formatting a bit, and add gimp_transform_tool_halt()
which really cleans the tool's state, so we don't end up with wrong
undo/redo actions in a new tool interaction.
2013-05-23 16:02:42 +02:00
ac5428787e Bug 598523 - Protect hidden layers from editing
Don't allow tool operations on invisible items, just like we do for
group layers or locked items.

Cleaned up and enhanced the patch a bit --Mitch
2013-05-13 23:29:43 +02:00
8cc53bbbdf app: forgot to invert the matrix in corrective mode when transforming the selection. 2013-04-23 17:15:23 +02:00
e5112fa540 Bug 690900 - Typo in GIMP UI
Fix typo in gimptransformtool.c
2012-12-30 20:38:37 +01:00
d4933b3052 Bug 674160 - Redesign of "Lock panel"
Apply and heavily modify patch from remyDev which adds "lock position"
to GimpItem, similar to "lock content". Lock position disables all
sorts of translation and transform, from the GUI and the PDB.

Cleaned up some aspects of the lock content code as well because a
second instance of similar code always shows what went wrong the first
time.
2012-11-09 11:17:25 +01:00
da795c1267 gimptransformtool: Restore code that apparently was for the flip tool 2012-09-20 15:18:00 +02:00
e546f2b43b Bug 683462 - cropping with rectangular select tool leaves misaligned...
Reset the tool on image changes again, but not if only the active
drawable changes, so keep bug #678890 closed:

Introduce new dirty flag GIMP_DIRTY_ACTIVE_DRAWABLE and set it on all
tools' dirty_mask except for rect select. Check the new flag when
reseting the active tool because of a drawable change.
2012-09-06 23:55:35 +02:00
6396e83057 transformtool: use new corner and side cursors appropriately considering current transform 2012-08-27 15:07:15 +02:00
e83b40982f transformtool: adjust handles a bit
Since the move handle is gone, the pivot can be normal sized and circle again,
also put shear handles at 3/4 rather than 3/5.
2012-08-22 22:49:45 +02:00
95584e5548 app: re-format a comment in gimptransformtool.c 2012-08-22 20:41:44 +02:00
8dfc72dca9 transformtool: Make real_pick_function and real_draw_gui implementations of vfuncs 2012-08-21 20:59:15 +02:00
b1acd93f5e Some formatting cleanup in the unified transform tool commits 2012-08-21 19:50:01 +02:00
08cd798ec6 transformtool: Set the cursor and tool cursor properly on each handle by way of the new cursor_update method 2012-08-20 20:28:21 +02:00
574df2b6db transformtool: We show corrective preview for selections and paths, so why not drawables 2012-08-20 15:46:47 +02:00
f84987de73 transformtool: Add the bunch of 8 separate options for 3 things 2012-08-20 15:46:46 +02:00
03117bdf40 transformtool: Update modifier keys for options, solves problem with perspective frompivot + constrain 2012-08-20 15:46:46 +02:00
501c15f910 transformtool: Add a pick_function method to the TransformTool class and remove some more hack duplication 2012-08-20 15:46:46 +02:00
293600c579 transformtool: Add a draw_gui method to the TransformTool class and remove some hack duplication 2012-08-20 15:46:46 +02:00
615b5fabfd transformtool: Add the five options instead of just two 2012-08-20 15:41:55 +02:00
003ccf2aec transformtool: Enable hit detection for new handles 2012-08-20 15:22:22 +02:00
c4143ff209 transformtool: Remove shift-clicking to accept transform since shift is used as a modifier 2012-08-20 15:22:22 +02:00