Commit Graph

25 Commits

Author SHA1 Message Date
Ell 6ed9b2bb7a Issue #4846 - Symmetry origin is wrong when painting on offset drawable
In gimp_symmetry_{mirror,mandala}_update_strokes(), adjust the
symmetry origin according to the drawable offset, so that it
remains fixed relative to the image regardless of the drawable
position.
2020-03-26 20:29:40 +02:00
Elad Shahar ed6517f094 app: Fix Mandala Symmetry Kaleidoscope mode - brush transform and stroke order
Changed the reflection method to find the middle of the slice the
user is drawing on, and reflecting on that. This reflects the slice
in place, making it easier to rotate it to the intended location.
This fix preserves the order the dabs are drawn on the
slices, to be counterclockwise.

Fixed the brush transform, by setting the reflect output variable,
and calculating accordingly.
2020-01-22 01:17:23 +02:00
Elad Shahar 36dd48aea6 Issue #4484: Add reflection option for mandala symmetry 2020-01-11 23:54:40 +01:00
Michael Natterer 7201d48231 Get rid of capitalized "ID" in function and variable names
and use "id" instead.
2019-08-23 22:23:23 +02:00
Michael Natterer 63695b4b21 libgimbase: merge gimpparam.h into gimpparamspecs.h
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
2019-07-31 10:16:21 +02:00
Ell 60a3965020 app: implement gimp_symmetry_get_operation() in terms of gimp_symmetry_get_matrix()
Remove the GimpSymmetry::get_operation() virtual function, and
instead implement gimp_symmetry_get_operation() by returning an
appropriate gegl:transform node based on the matrix returned by
gimp_symmetry_get_matrix().  The returned node is owned by the
caller; since we no longer use the node's identity for caching
trnasformed brushes, we no longer cache the transformation nodes.

Remove the function's paint_width and paint_height parameters, and
instead return a transformation that should be applied at the
center of the brush.  This simplifies the application of the
transformation in the Clone and Heal tools, as per the next commit.

Remove the implementation of GimpSymmetry::get_operation() from all
its subclasses, which should now only implement
GimpSymmetry::get_transform().
2019-05-29 05:26:42 -04:00
Ell e0f2a6f1be app: add gimp_symmetry_get_transform()
Add a GimpSymmetry::get_transform() virtual function, and a
corresponding gimp_symmetry_get_transform() function, which return
the brush transform corresponding to a given symmetry stroke in
terms of the rotation angle and reflection flag (in contrast to
gimp_symmetry_get_operation() which returns the same transforation
in terms of a GeglNode).  This would allow us to simplify, fix, and
improve the painting-code perofmrnace in the next commits.

Implement GimpSymmetry::get_transform() in its various subclasses.
2019-05-26 14:45:38 -04:00
Michael Natterer 5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Michael Natterer 0cb3e75f79 app: use a lot of g_clear_object() and g_clear_pointer()
More than 2000 lines of code less in app/, instead of

if (instance->member)
  {
    g_object_unref/g_free/g_whatever (instance->member);
    instance->member = NULL;
  }

we now simply use

g_clear_object/pointer (&instance->member);
2017-07-15 18:42:44 +02:00
Jehan 65be37b37b Bug 768871: improve symmetry labels. 2016-07-19 12:34:01 +02:00
Michael Natterer eae2261f16 app: tag the symmetry properties as pixel-coordinate/pixel-distance
so they get the proper soft limits in the generated GUI. Also rename
some properties for consisency, and add some blank lines for better
readability.
2016-07-06 12:37:10 +02:00
Jehan e8aac6d5ac app: do not allow mandala center position out of the image dimensions. 2016-07-01 14:58:24 +02:00
Jehan 4e6d320591 app: remove current implementation of GimpSpinScale soft bounds.
Mitch gets a better idea to deal with soft limits (i.e. min/max values
different from the property min/max) applied to a spin scale created by
gimp_prop_spin_scale_new().
So let's just remove the current implementation (using locale data on
the GimpConfig object). The symmetry spin scales are back with crazy
huge maximums, which makes quite a horrible GUI, but this is only
temporary until Mitch commits his new implementation.
2016-07-01 13:58:55 +02:00
Jehan a10b688b64 app: rename "update-ui" signal to "gui-param-changed".
Therefore having a signal name more in line with other signals. This
reflects the property flag's naming: GIMP_SYMMETRY_PARAM_GUI.
2016-06-28 20:04:38 +02:00
Jehan f713c86d9f app: disconnect symmetries' callbacks connected to image signals...
... on symmetry destruction.
Use g_signal_connect_object() which does this automatically.
2016-06-28 19:30:44 +02:00
Richard Kreckel dd9b0fc55b Bug 768044 - Fix many typos
This fixes many typos in comments and one in a user-visible string (msgid
"center abscisse" changed to "center abscissa" in affected po files. too).
2016-06-26 00:35:24 +02:00
Jehan cafa912c98 app: allow locale lower and upper values in gimp_prop_spin_scale_new().
Currently a GimpSpinScale created with gimp_prop_spin_scale_new() will
use the associated property's lower and upper values.
Unfortunately these generic values may not be always relevant and we
may want to construct a spin scale UI adapted to the current image.
For instance, several symmetry painting have a x/y property which has
to stay within the image's dimension, but changing the property's lower
and upper values would affect the symmetry on the class level (i.e. for
all similar symmetries on all images).
Let's allow setting data on object with key "property-name:min|max" to
provide locale min/max values specifically for this object.
This is used only on the symmetry dock for now, but could be used as
well on GEGL op UIs.
2016-06-14 16:52:52 +02:00
Michael Natterer e5b6806fe2 app: port tons of files to the new GIMP_CONFIG_PROP_FOO() macros
and remove lots of labels from calls to gimp_prop_foo_new(). Also
had to manually remove some unwanted labels that are now added
automatically, fixes bug #761880.
2016-02-11 23:46:24 +01:00
Jehan 609dcc5448 app: mandala center coordinates should also be settable by number...
... not only by guide moving. Both ways are complementary.
2016-02-11 17:12:44 +01:00
Michael Natterer 18316c41a5 app: use the new GIMP_CONFIG_PROP_FOO()
instead of manual g_object_class_install_property().
2016-02-10 01:38:08 +01:00
Michael Natterer 8bb00c639a app: simplify symmetry GUI generation
Remove GimpSymmetry::get_settings() and instead tag the properties that
should have a GUI with the GIMP_SYMMETRY_PARAM_GUI flag. Also use plain
g_object_class_install_property() because that allows for separate nick
and blurb. Finally, use gimp_prop_gui_new() to generate the GUI,
2016-02-06 23:20:44 +01:00
Jehan e01d56969d app: move all guide styling to gimpcanvas-style. 2016-02-03 19:38:32 +01:00
Michael Natterer 3415d22e58 app: some cleanup in the new symmetry code, mostly harmless 2016-02-03 14:29:23 +01:00
Alexandre Prokoudine 7cc0a9d4ba Fix a typo in a user-visible message 2016-02-03 10:22:59 +03:00
Jehan 1c0a0a47de app: add a "Mandala" symmetry.
This is basically a multiple rotation around a given center.
2016-02-02 21:15:13 +01:00