Commit Graph

39250 Commits

Author SHA1 Message Date
Ell 90a024be54 app: improve spinscale target calculation
So pedantic... :)
2017-10-18 15:43:34 -04:00
Ell 8d90999814 app: highlight upper/lower halves of spinscales while hovering
When the mouse hovers over the upper or lower half of a spinscale,
highlight the corresponding area, to hint that the two halves
behave differently.  This seems to cause a lot of confusion, so the
different cursors are apparently not enough :P

We use a low-opacity version of the current theme's text color for
the highlight, since it should have a good contrast to both the bar
color and the background color.
2017-10-18 15:01:57 -04:00
Ell 2bbb0f509b app: fix tentative gradient leak in the blend tool editor 2017-10-18 15:01:57 -04:00
Ell 6e5aeb4fbf app: indentation fix in the blend tool editor 2017-10-18 15:01:56 -04:00
Jordi Mas cdedc120c5 Update Catalan translation 2017-10-18 07:44:54 +01:00
Ell 5456ddbb40 Bug 683553 - Spinscale scrollvalues in Brushsize are much too small
Increase the step and page increments of the brush radius spinscale
in the brush editor to 1.0 and 10.0, respectively, to match those of
the corresponding spinscale in the paint tool options.
2017-10-17 08:47:27 -04:00
Ell 2bf166d2ce app: use fuzzy comparison in various layer-mode blendfuncs
Use fuzzy comparison, instead of exact comparison, in various layer-mode
blendfuncs which may be sensitive to small error.
2017-10-17 08:47:23 -04:00
Ell d4d8dbbc1b app: add custom gui for gegl:color-to-alpha(-plus)
Add a specialized propgui constructor for gegl:color-to-alpha-plus.
This op is currently in the workshop, but is set to be merged with
the existing gegl:color-to-alpha, so we omit the '-plus' from file-
and function-names.

The new op adds a pair of properties to control the radii, relative
to the selected color, below which colors become fully transparent,
and above which colors remain fully opaque.  Allow these properties
to be set by picking a color from the image, and calculating the
radius accordingly.
2017-10-16 12:38:38 -04:00
Ell c5b88702e6 app: allow specifying a callback function for propgui pickers
Allow propgui constructors to specify an (optional) callback function
when creating pickers, to be called when a color/coordinate is picked,
similarly to controller callbacks.

Implement picker callback support in GimpFilterTool.  When the active
picker has an associated callback function, call it instead of the
class's color_picked() function.

Add lots of "#include <gegl.h>" to .c files that miss it, which is
now necessary, since this commit adds a Babl* parameter in
propgui-types.h.
2017-10-16 12:38:37 -04:00
Ell 92cd4d4619 app: s/diffration-patterns/diffraction-patterns/ 2017-10-15 13:35:05 -04:00
Piotr Drąg 6c1e3beb69 Update Polish translation 2017-10-15 16:34:58 +02:00
Mario Blättermann 0655c70350 Update German translation 2017-10-14 13:08:00 +00:00
Mario Blättermann 087003746c Update German translation 2017-10-14 12:50:38 +00:00
Ell ae9b9c642d app: preserve dirname when switching save dialogs
When switching between the save/export dialogs, preserve the
dirname part of the path (or rather, use it to set the dialog's
current folder,) not just the basename.
2017-10-11 06:39:40 -04:00
Ell 862bb00478 app: clear tentative gradient when halting the blend tool
Currently, it should already be cleared at this point, but still.
2017-10-11 06:39:38 -04:00
Jehan 5a8033151f app: fix function doc-comment.
Remove a sentence which does not apply to this function. Bad copy-paste.
2017-10-11 00:29:19 +02:00
Alexandre Prokoudine c5f94c1f27 NEWS: update the list of contributors 2017-10-10 21:18:38 +03:00
Ell 9548d54e12 app: fix conversion of midpoints to stops in the blend tool, when ...
... the gradient is reversed, or offset > 0

Also, add a few assertions.
2017-10-10 05:58:46 -04:00
Alexandre Prokoudine 695b6ed260 NEWS: mention newly added on-canvas gradient editing 2017-10-10 09:35:52 +03:00
Ell 0e9747380b app: in GimpOperationBlend, fix left/right-most colors when offset > 0 2017-10-09 13:15:42 -04:00
Jordi Mas c465e17ed6 Update Catalan translation 2017-10-09 19:13:03 +02:00
Ell a789c6e5e2 app: in GimpOperationBlend, swap leftmost and rightmost colors when ...
... rendering a reversed gradient

Finishes up the last commit.
2017-10-09 13:03:50 -04:00
Ell 4e2e60caf4 app: fix leftmost and rightmost gradient colors in GimpOperationBlend
When rendering a gradient with a repeat mode of NONE, don't sample
the gradient at 0.0 and 1.0, for pixels that lie to the left and to
the right of the gradient, respectively.  Instead, use the left
color of the leftmost segment directly, and, likewise, the right
color of the rightmost segment.  This always gives us the right
color for such pixels, even when there are gradient stops, that may
use different colors, at 0.0 and 1.0,
2017-10-09 12:48:56 -04:00
Ell dfeafcb175 app: cache last-sampled gradient segment in GimpOperationBlend
Remember the gradient segment at which the most-recent sample lies,
and pass it to gimp_gradient_get_color_at() as a seed for segement
lookup on the next sample.  This improves the performance
marginally.
2017-10-09 12:48:56 -04:00
Ell 4bfa6e716e app: don't update blend tool filter upon irrelevant line changes
When one of the line widget's properties changes, only update the
blend tool filter if the property has an effect on the result.  In
particular, don't update the filter when only the selection
changes.
2017-10-09 12:48:55 -04:00
Ell 429bc5507c app: fix fg/bg color change handling in the blend tool
Separate the handling of changes to the FG/BG color from the gradient
dirty signal handling, so that the gradient editor doesn't purge the
history in response.  Additionally, correctly respond to such changes
whenever the gradient has segments that depend on the FG/BG colors,
even if the dependency is introduced after the gradient is selected.
2017-10-09 12:48:55 -04:00
Ell 4f6b4d27bc app: implement tool undo for gradient editing in the blend tool
Move the tool undo functionality of the blend tool to the editor,
and add support for undoing gradient edit operations.  Each undo
step that affects the gradient holds, in addition to the line
endpoint poisitions, a copy of the gradient at the beginning of the
operation, as well as necessary information to allow the selection
to "follow" undo.  When undoing the operation, the saved gradient
is copied back to the active gradient.

To avoid all kinds of complex scenarios, when the active gradient
changes, or when the gradient is modified externally (e.g., by the
(old) gradient editor), all undo steps that affect the gradient are
deleted from the history, while those that affect only the endpoint
positions are kept.
2017-10-09 12:48:55 -04:00
Ell 9469ac26f0 app, libgimpbase: implement blend tool gui for gradient midpoints
Allows setting the midpoint's position, blending function, and
coloring type.

The midpoint can be converted to a stop, and centered, through
editor buttons.
2017-10-09 12:48:55 -04:00
Ell 1aa4877426 app: implement blend tool gui for gradient stops
Allows setting the stop's position, and its left and right colors
and color types.  A chain button can be used to modify the two
colors (and color types) together.

The stop can be deleted through an editor button.
2017-10-09 12:48:55 -04:00
Ell 8d12fada8a app: implement blend tool gui for gradient endpoints
Allows setting the endpoint's position, its color, and its color
type.
2017-10-09 12:48:55 -04:00
Ell a9ca354d26 app: add tool gui to the blend tool
To be used by the blend tool gradient editor to edit the gradient
endpoint/stop/midpoint properties corresponding to the selected
handle.

The GUI is currently empty; the following commits add its contents.
2017-10-09 12:48:54 -04:00
Ell 420ea8037a app: convert midpoints to stops via double-click in the blend tool
When a midpoint is double-clicked, convert it into a gradient stop
(i.e., split the corresponding segment at the midpoint,) by
responding to the line's handle-clicked signal.
2017-10-09 12:48:54 -04:00
Ell 63c8fc73dd app: handle prepare-to-remove-slider signal in the blend tool
Add a tentative_gradient member to GimpBlendTool, which, when set,
is displayed instead of the current gradient.

Use this to show a version of the gradient with the currently
selected stop deleted, upon receiving a prepare-to-remove-slider
signal, i.e., when the slider is about to be removed.
2017-10-09 12:48:54 -04:00
Ell 9ae09fb03a app: add support for removing gradient stops to the blend tool
... by responding to the line's remove-slider signal.
2017-10-09 12:48:54 -04:00
Ell 29bae454a2 app: add support for adding gradient stops to the blend tool
... by responding to the line's can-add-slider and add-slider
signals.
2017-10-09 12:48:53 -04:00
Ell 690f51d4eb app: modify the gradient in response to blend-tool slider motion
Update the gradient's segment endpoint and midpoint positions,
according to the sliders.
2017-10-09 12:48:53 -04:00
Ell ac1b788787 app: add sliders for gradient stops and midpoints in the blend tool
They can't be used to modify the gradient yet, but soon...  Very
soon!
2017-10-09 12:48:53 -04:00
Ell 4f1195be29 app: add "modify active gradient" option to the blend tool
Add a boolean "modify active gradient" option to the blend tool.
when checked, the active gradient is modified in-place while edited.
When unchecked, the active gradient is copied to the internal
"custom" gradient upon editing, and the custom gradient becomes
subsequently active.

Show a hint when the option is checked, but the active gradient is
non-writable, and can't be edited directly.

This commit adds the new gimpblendtool-editor.[hc] files, which are
where the gradient-editing related functionality of the blend tool
is going to go.
2017-10-09 12:48:53 -04:00
Ell f95f8eb347 app: add "instant mode" option to the blend tool
Add a boolean "instant mode" option to the blend tool, togglable
using shift.  When checked, commit the gradient immediately when
the mouse is released.

When not in instant mode, don't commit the gradient when clicking
outside the line, since this will become easy to do accidentally
once we add on-canvas gradient editing.
2017-10-09 12:48:53 -04:00
Ell 02ad016b39 app: don't show a PLUS cursor modifier before starting the blend tool
We're going to use the PLUS modifier for adding gradient stops.
2017-10-09 12:48:52 -04:00
Ell 5d2555bdb5 app: add gimp_color_panel_dialog_response(); add "response" signal
Add gimp_color_panel_dialong_response() to GimpColorPanel, which
emits a response for the color panel's color dialog, if shown.

Add a "response" signal to GimpColorPanel, which is emitted upon
color dialog response.

In both cases, the response is a GimpColorDialogState, which should
be either GIMP_COLOR_DIALOG_OK or GIMP_COLOR_DIALOG_CANCEL, and not
an actual dialog response id.
2017-10-09 12:48:52 -04:00
Ell 32de48780b app: use get_{left,right}_flat_color() in gradient editor
Use gimp_gradient_get_{left,right}_flat_color(), instead of
gimp_gradient_get_color_at(), to get the selection endpoints'
colors in the gradient editor, so that the correct colors are used
under any condition (in particular, if there are 0-length
segments.)
2017-10-09 12:48:52 -04:00
Ell 1f3030eb41 app: improve curved gradient segment sampling
Improve the sampling performance of curved gradient segments, and
its behavior when the segment's midpoint is close to one of its
limits.
2017-10-09 12:48:52 -04:00
Ell 1b2a395e88 app: improve num. stability of gimp_gradient_segment_range_compress()
When using gimp_gradient_segment_range_compress() to expand a 0-
length segment, redistribute the range's endpoints and midpoints
uniformly, rather than using the regular code path, which would
result in NaN values.

Make sure that the left and right endpoints of the range are
*exactly* equal to the new left and right values.  Previously,
they could be slightly off due to numerical errors.
2017-10-09 12:48:52 -04:00
Ell 3aff0a1a0e app: treat gradient segments as clopen ranges
Treat gradient segment exents as [left, right) ranges, instead of
[left, right], so that they don't overlap, and each point
corresponds to a unique color.

Perform less comparisons in gimp_gradient_get_segment_at_internal().
2017-10-09 12:48:52 -04:00
Ell d710773aba app: add gimp_gradient_segment_range_merge()
... which merges a segment range into a single segment, that spans
the entire range, and has the same endpoint colors.  The merged
segment's midpoint is at its center, and its blend function and
coloring type are those of the range's segments if they're uniform,
or the default ones otherwise.
2017-10-09 12:48:51 -04:00
Ell 082f6a4122 app: add gimp_gradient_segment_range_get_n_segments()
... which returns the number of segments in a range.
2017-10-09 12:48:51 -04:00
Ell c5faf02759 app: add gimp_gradient_split_at()
... which splits a gradient segment at an arbitrary position.

Implement gimp_gradient_segment_split_midpoint() in terms of the new
function.
2017-10-09 12:48:51 -04:00
Ell 6840dabad4 app: add gimp_gradient_segment_get_{left,right}_flat_color()
... which returns the flat (context-independent) left and right
colors of a egment.  Replace code that calculates the flat color
explicitly with calls to these functions.
2017-10-09 12:48:51 -04:00
Ell 6971b89397 app: implement compare() for GimpGradient
Order the custom gradient before all the other gradients, and use
the default ordering for the rest.
2017-10-09 12:48:51 -04:00