1. 10 Oct, 2017 4 commits
  2. 09 Oct, 2017 36 commits
    • Ell's avatar
    • Jordi Mas's avatar
      Update Catalan translation · c465e17e
      Jordi Mas authored
      c465e17e
    • Ell's avatar
      app: in GimpOperationBlend, swap leftmost and rightmost colors when ... · a789c6e5
      Ell authored
      ... rendering a reversed gradient
      
      Finishes up the last commit.
      a789c6e5
    • Ell's avatar
      app: fix leftmost and rightmost gradient colors in GimpOperationBlend · 4e2e60ca
      Ell authored
      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,
      4e2e60ca
    • Ell's avatar
      app: cache last-sampled gradient segment in GimpOperationBlend · dfeafcb1
      Ell authored
      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.
      dfeafcb1
    • Ell's avatar
      app: don't update blend tool filter upon irrelevant line changes · 4bfa6e71
      Ell authored
      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.
      4bfa6e71
    • Ell's avatar
      app: fix fg/bg color change handling in the blend tool · 429bc550
      Ell authored
      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.
      429bc550
    • Ell's avatar
      app: implement tool undo for gradient editing in the blend tool · 4f6b4d27
      Ell authored
      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.
      4f6b4d27
    • Ell's avatar
      app, libgimpbase: implement blend tool gui for gradient midpoints · 9469ac26
      Ell authored
      Allows setting the midpoint's position, blending function, and
      coloring type.
      
      The midpoint can be converted to a stop, and centered, through
      editor buttons.
      9469ac26
    • Ell's avatar
      app: implement blend tool gui for gradient stops · 1aa48774
      Ell authored
      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.
      1aa48774
    • Ell's avatar
      app: implement blend tool gui for gradient endpoints · 8d12fada
      Ell authored
      Allows setting the endpoint's position, its color, and its color
      type.
      8d12fada
    • Ell's avatar
      app: add tool gui to the blend tool · a9ca354d
      Ell authored
      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.
      a9ca354d
    • Ell's avatar
      app: convert midpoints to stops via double-click in the blend tool · 420ea803
      Ell authored
      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.
      420ea803
    • Ell's avatar
      app: handle prepare-to-remove-slider signal in the blend tool · 63c8fc73
      Ell authored
      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.
      63c8fc73
    • Ell's avatar
      app: add support for removing gradient stops to the blend tool · 9ae09fb0
      Ell authored
      ... by responding to the line's remove-slider signal.
      9ae09fb0
    • Ell's avatar
      app: add support for adding gradient stops to the blend tool · 29bae454
      Ell authored
      ... by responding to the line's can-add-slider and add-slider
      signals.
      29bae454
    • Ell's avatar
      app: modify the gradient in response to blend-tool slider motion · 690f51d4
      Ell authored
      Update the gradient's segment endpoint and midpoint positions,
      according to the sliders.
      690f51d4
    • Ell's avatar
      app: add sliders for gradient stops and midpoints in the blend tool · ac1b7887
      Ell authored
      They can't be used to modify the gradient yet, but soon...  Very
      soon!
      ac1b7887
    • Ell's avatar
      app: add "modify active gradient" option to the blend tool · 4f1195be
      Ell authored
      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.
      4f1195be
    • Ell's avatar
      app: add "instant mode" option to the blend tool · f95f8eb3
      Ell authored
      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.
      f95f8eb3
    • Ell's avatar
      app: don't show a PLUS cursor modifier before starting the blend tool · 02ad016b
      Ell authored
      We're going to use the PLUS modifier for adding gradient stops.
      02ad016b
    • Ell's avatar
      app: add gimp_color_panel_dialog_response(); add "response" signal · 5d2555bd
      Ell authored
      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.
      5d2555bd
    • Ell's avatar
      app: use get_{left,right}_flat_color() in gradient editor · 32de4878
      Ell authored
      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.)
      32de4878
    • Ell's avatar
      app: improve curved gradient segment sampling · 1f3030eb
      Ell authored
      Improve the sampling performance of curved gradient segments, and
      its behavior when the segment's midpoint is close to one of its
      limits.
      1f3030eb
    • Ell's avatar
      app: improve num. stability of gimp_gradient_segment_range_compress() · 1b2a395e
      Ell authored
      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.
      1b2a395e
    • Ell's avatar
      app: treat gradient segments as clopen ranges · 3aff0a1a
      Ell authored
      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().
      3aff0a1a
    • Ell's avatar
      app: add gimp_gradient_segment_range_merge() · d710773a
      Ell authored
      ... 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.
      d710773a
    • Ell's avatar
      app: add gimp_gradient_segment_range_get_n_segments() · 082f6a41
      Ell authored
      ... which returns the number of segments in a range.
      082f6a41
    • Ell's avatar
      app: add gimp_gradient_split_at() · c5faf027
      Ell authored
      ... which splits a gradient segment at an arbitrary position.
      
      Implement gimp_gradient_segment_split_midpoint() in terms of the new
      function.
      c5faf027
    • Ell's avatar
      app: add gimp_gradient_segment_get_{left,right}_flat_color() · 6840daba
      Ell authored
      ... 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.
      6840daba
    • Ell's avatar
      app: implement compare() for GimpGradient · 6971b893
      Ell authored
      Order the custom gradient before all the other gradients, and use
      the default ordering for the rest.
      6971b893
    • Ell's avatar
      app: implement copy() for GimpGradient · 17583ff0
      Ell authored
      ... instead of duplicate().
      17583ff0
    • Ell's avatar
      app: add "custom" gradient · 2ad9f40d
      Ell authored
      An internal gradient object, that will be used by the blend tool
      when editing a gradient.  By default, the active gradient will not
      be edited directly, but rather, upon editing, the active gradient's
      contents will be copied to the custom gradient, which will then
      become the active gradient and be edited.  This allows editing both
      writable and nonwritable gradients without modifying them, and
      without having to duplicate them.
      2ad9f40d
    • Ell's avatar
      app: add compare() virtual function to GimpData · f36f234f
      Ell authored
      ... which subclasses can override to refine comparison.  Provide a
      default implementation that uses the current logic.
      f36f234f
    • Ell's avatar
      app: add gimp_data_copy() · 33de4d55
      Ell authored
      ... which copies the contents of a GimpData into an existing GimpData,
      without creating a new instance.
      
      Add a copy() virtual function to GimpData, which subclasses can
      override to implement copying; gimp_data_copy() may only be called
      for types that implement copy().  Keep the duplicate() virtual
      function around, but provide a default implementation that creates
      a new object of the source type, and uses copy() to copy the source
      object into it.
      33de4d55
    • Ell's avatar
      app: improve status messages of GimpToolLine · 507bc437
      Ell authored
      ... to cover all the new stuff.
      507bc437