Bug 427658

Summary: Weird interaction between Polygonal Selection Tool and Assistant Previews
Product: [Applications] krita Reporter: Autumn Lansing <autumn>
Component: Tool/AssistantsAssignee: Dmitry Kazakov <dimula73>
Status: RESOLVED FIXED    
Severity: normal CC: ahab.greybeard, halla, info
Priority: NOR Keywords: regression
Version: 4.4.0   
Target Milestone: ---   
Platform: Appimage   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Artifacts with polygonal selection tool

Description Autumn Lansing 2020-10-13 20:25:00 UTC
SUMMARY
Using the Polygonal Selection Tool while Assistant Previews are visible produces odd artifacts on screen wherever the tool's lines intersect with the preview lines. The preview lines are basically erased and redrawn elsewhere along the tool's line, multiple times if you stop the pointer and move it again. This happens on every side of the polygon until you complete the shape, and then all the artifacts vanish and everything is back to normal. This happens with mouse or tablet pen.

I tried to get a screenshot of the problem but it didn't appear. The screenshot showed everything normally. Also, if I pull up another program window in front of Krita (alt-tab to something else) while the artifacts are present and then switch back again to Krita, the artifacts will be gone.

This behavior is new to 4.4.

STEPS TO REPRODUCE
1. Ensure that Assistant Previews are visible.
2. Create either a Concentric Ellipse or a Parallel Ruler, or both.
3. Use the polygon selection tool and create a selection across preview lines.

OBSERVED RESULT
Preview lines are disrupted and produce odd artifacts on screen.

EXPECTED RESULT
No interaction between preview lines and selection tool.

SOFTWARE/OS VERSIONS
Krita

 Version: 4.4.0
 Languages: en_US, en
 Hidpi: true

Qt

  Version (compiled): 5.12.9
  Version (loaded): 5.12.9

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 5.7.15-100.fc31.x86_64
  Pretty Productname: Fedora 31 (MATE-Compiz)
  Product Type: fedora
  Product Version: 31
  Desktop: X-Cinnamon

OpenGL Info
 
  Vendor:  "NVIDIA Corporation" 
  Renderer:  "GeForce GTX 660/PCIe/SSE2" 
  Version:  "4.6.0 NVIDIA 450.66" 
  Shading language:  "4.60 NVIDIA" 
  Requested format:  QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::CompatibilityProfile) 
  Current format:    QSurfaceFormat(version 4.6, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::CompatibilityProfile) 
     Version: 4.6
     Supports deprecated functions true 
     is OpenGL ES: false 

QPA OpenGL Detection Info 
  supportsDesktopGL: true 
  supportsOpenGLES: true 
  isQtPreferOpenGLES: false 

Hardware Information

  GPU Acceleration: auto
  Memory: 16001 Mb
  Number of Cores: 6
  Swap Location: /tmp

Current Settings

  Current Swap Location: /tmp
  Current Swap Location writable: true
  Undo Enabled: true
  Undo Stack Limit: 30
  Use OpenGL: true
  Use OpenGL Texture Buffer: true
  Use AMD Vectorization Workaround: false
  Canvas State: OPENGL_SUCCESS
  Autosave Interval: 300
  Use Backup Files: true
  Number of Backups Kept: 1
  Backup File Suffix: ~
  Backup Location: Same Folder as the File
  Backup Location writable: false
  Use Win8 Pointer Input: false
  Use RightMiddleTabletButton Workaround: false
  Levels of Detail Enabled: false
  Use Zip64: false


Display Information
Number of screens: 2
	Screen: 0
		Name: HDMI-0
		Depth: 24
		Scale: 1
		Resolution in pixels: 1920x1080
		Manufacturer: LG Electronics
		Model: LG IPS FULLHD
		Refresh Rate: 60
	Screen: 1
		Name: DVI-D-0
		Depth: 24
		Scale: 1
		Resolution in pixels: 1920x1080
		Manufacturer: HPN
		Model: HP VH240a-
		Refresh Rate: 60
Comment 1 Ahab Greybeard 2020-10-14 15:13:26 UTC
Created attachment 132352 [details]
Artifacts with polygonal selection tool

I can confirm this for the 4.4.0 appimage and also for the 4.3.0 appimage.

The artifacts happen if canvas graphics acceleration is turned off.
When the polygonal selection is completed, the artifacts go away.
If any other window becomes active, the artifacts go away.

The artifacts seem to be drawn fragments of the assistant preview lines and they are 'swept away' by the polygonal selection construction line.

When the selection is completed then the artifacts go away.

With the Outline(freehand) selection tool, there are artifacts but they are concentrated at the point of drawing the selection.

With the rectangular and elliptical selection tool, there are short lived temporary artifacts due to break up of the assistant preview lines but the preview lines seem to be continuously refreshed.

When the selection is completed and drawn, the artifacts go away.
Comment 2 Ahab Greybeard 2020-10-14 15:14:12 UTC
A screenshot of the artifacts is attached
Comment 3 Ahab Greybeard 2020-10-28 14:27:31 UTC
For Comment 1, I misled myself by having a pre-existing selection:

The artifacts happen with canvas graphics acceleration on or off.

With no pre-existing selection, the artifacts are extensive and long lived.
With a pre-existing selection on the canvas, the artifacts are local at the cursor and transient (but still distracting).
Comment 4 Ahab Greybeard 2020-10-28 14:29:38 UTC
*** Bug 428315 has been marked as a duplicate of this bug. ***
Comment 5 Autumn Lansing 2020-12-08 19:15:42 UTC
Just updating to say that this still occurs in 4.4.2-beta1.
Comment 6 Dmitry Kazakov 2020-12-15 14:24:52 UTC
The bug happens only on the release builds of Krita (or in a docker build), because the problem is in partial updates.
Comment 7 Dmitry Kazakov 2020-12-15 19:03:08 UTC
Git commit 8fd1874a6410292ceabe55c578f870ddd806eae2 by Dmitry Kazakov.
Committed on 15/12/2020 at 19:02.
Pushed by dkazakov into branch 'krita/4.3'.

Fix painting assistant decorations in selection tools

M  +52   -45   libs/ui/tool/kis_tool_paint.cc
M  +7    -0    plugins/tools/selectiontools/kis_tool_select_path.cc

https://invent.kde.org/graphics/krita/commit/8fd1874a6410292ceabe55c578f870ddd806eae2
Comment 8 Dmitry Kazakov 2020-12-15 19:04:40 UTC
Git commit ee84722df264883cc5841d2000d94b35c9da478c by Dmitry Kazakov.
Committed on 15/12/2020 at 19:04.
Pushed by dkazakov into branch 'krita/4.4.2'.

Fix painting assistant decorations in selection tools

M  +52   -45   libs/ui/tool/kis_tool_paint.cc
M  +7    -0    plugins/tools/selectiontools/kis_tool_select_path.cc

https://invent.kde.org/graphics/krita/commit/ee84722df264883cc5841d2000d94b35c9da478c
Comment 9 Dmitry Kazakov 2020-12-15 19:05:15 UTC
Git commit 652a9e3e73757cdd809fe495ff0d22d1db0a010e by Dmitry Kazakov.
Committed on 15/12/2020 at 19:05.
Pushed by dkazakov into branch 'master'.

Fix painting assistant decorations in selection tools

M  +52   -45   libs/ui/tool/kis_tool_paint.cc
M  +7    -0    plugins/tools/selectiontools/kis_tool_select_path.cc

https://invent.kde.org/graphics/krita/commit/652a9e3e73757cdd809fe495ff0d22d1db0a010e