Add Stroke Selection Edge function
Closed, ResolvedPublic

dkazakov created this task.Jul 20 2016, 8:20 PM

Requirements for the project

  1. Stroke with configurable vector lines:
    1. Should be able to draw a line with the following options:
      1. Antialiasing (?)
      2. Width measured in pixels, mm and inches
      3. Line style:
        1. Cap Style
        2. Join Style
        3. Miter Style
        4. Dash Style
    2. The color of the line should be the currently selected Foreground Color
    3. If the filling is "on", then the internals of the polygon should be filled with the currently selected Background Color (or chosen in the GUI like in polygon tool).
  2. Stroke selection with the currently selected brush preset
    1. The color of the line should be the currently selected Foreground Color
    2. If the filling is "on", then the internals of the polygon should be filled with the currently selected Background Color (or chosen in the GUI like in polygon tool).
  3. The user should be able to adjust where he wants to draw the line:
    1. exactly on selection
    2. outside the selection
    3. inside the selection

Plan of the iterations

  1. Outlining with the current brush
    1. Implement GUI for point 2.A and 2.B
    2. Implement the painting itself for 2.A and 2.B
    3. Give out to the users for testing
  2. Basic outlining with vector tools
    1. Implement GUI for 1.A.b, 1.B and 1.C
    2. Implement painting of the outlines with the available options
    3. Give out to the users for testing
  3. Advanced outlining with vector tools
    1. Implement GUI for 1.A.a and 1.A.c
    2. Implement painting of the outlines with the available options
    3. Give out to the users for testing
  4. Profit!!!

Recommendations

  1. Stroke with configurable vector lines:
    1. Should be able to draw a line with the following options:
      • To draw with all these options just use KisPainter::drawPainterPath() and pass it QPen object with all the corresponding options configured.
      • It would be nice if the painter calls would be wrapped into a StrokeStrategy to solve the threading issues. But that might be done after the initial draft implementation.
      • GUI widget for configuring Cap, Join, Miter and Dash options can be found in KoStrokeConfigWidget
  2. Stroke selection with the currently selected brush preset
    • KisToolPolyline::finishPolyline(), use KisFigurePaintingToolHelper class, which has all the filling options needed.
  3. The user should be able to adjust where he wants to draw the line:
    • Use KisLsUtils::growSelectionUniform() on the copy of the current selection
woltherav closed this task as Resolved.Oct 11 2019, 1:25 PM