Skip to content

paintToolOutline: use drawPolyline() instead of drawPolygon()

Mike Will requested to merge myqwil/krita:show_line_preview into master

When Canvas Graphics Acceleration is turned off, tools that draw lines (Line Tool, Polyline Tool, Polygon Tool, Polygonal Selection Tool) were not displaying their preview outlines.

This is because the function drawPolygon() does not draw polygons with fewer than 3 points (solo straight lines). It also draws an additional line that connects the last point to the first point, which is inconsistent with the graphics-accelerated behavior.

Test Plan

  1. Go to Settings -> Configure Krita -> Display and uncheck Canvas Graphics Acceleration
  2. Open a Document and try using any tool that draws lines, (Line Tool, Polyline Tool, Polygon Tool, Polygonal Selection Tool)
  • When using the Line Tool, make sure that Show Guideline is enabled in the Tool Options docker.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
Edited by Mike Will

Merge request reports