Bug 484889 - Artifacts with rectangular grid
Summary: Artifacts with rectangular grid
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 5.2.2
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-01 20:15 UTC by grum999
Modified: 2024-04-04 12:34 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Example of bug (368.54 KB, video/webm)
2024-04-01 20:15 UTC, grum999
Details

Note You need to log in before you can comment on or make changes to this bug.
Description grum999 2024-04-01 20:15:32 UTC
Created attachment 168036 [details]
Example of bug

SUMMARY
Following this KA post:
https://krita-artists.org/t/grids-guides-improvements/85979/16?u=grum999

We can see glitches/artifacts on rectangular grid when brush is moved over canvas.
- Occurs only if canvas acceleration is ON
- And only impact subdivision lines style is set to “Lines” (“Dashed”, “Dot” works)

STEPS TO REPRODUCE
1. Create a new document
2. Select any brush (basic-1)
3. Setup a rectangular grid with subdivision lines as "Solid"
4. Move the brush over the grid 

OBSERVED RESULT
Artifacts & Glitches on the grid

EXPECTED RESULT
Grid is properly rendered

ADDITIONAL INFORMATION
It works properly in Krita 5.1.3 and bug start from Krita 5.1.5
Comment 1 Dmitry Kazakov 2024-04-04 12:34:34 UTC
Git commit 5d5719abba4717019d2ed6491431672b108a0d98 by Dmitry Kazakov, on behalf of Grum 999.
Committed on 04/04/2024 at 12:34.
Pushed by dkazakov into branch 'master'.

Fix grids glitches when subdivision style is solid

Bug has been introduced with commit 764719791a4ce6887aedc9d92777f3c4a03198c6 (to fix bug 461912)

From Qt's documentation, setDashOffset() method implicitly converts the style of the pen to Qt::CustomDashLine.
When current line style is solid, it seems the custom dash line is not soid anymore and this generate glitches.

To avoid the problem, need to to check if style is solid or not before updating dash offset (update only if not solid).

In addition, the original commit only 'fixed' dash offset problem for subdivision but not for main grid division; this commit fix both (main & subdivision) grids lines.

M  +13   -3    libs/ui/canvas/kis_grid_decoration.cpp

https://invent.kde.org/graphics/krita/-/commit/5d5719abba4717019d2ed6491431672b108a0d98
Comment 2 Dmitry Kazakov 2024-04-04 12:34:56 UTC
Git commit fca99898de4472ca2bd41498f568072fb1ef9349 by Dmitry Kazakov, on behalf of Grum 999.
Committed on 04/04/2024 at 12:34.
Pushed by dkazakov into branch 'krita/5.2'.

Fix grids glitches when subdivision style is solid

Bug has been introduced with commit 764719791a4ce6887aedc9d92777f3c4a03198c6 (to fix bug 461912)

From Qt's documentation, setDashOffset() method implicitly converts the style of the pen to Qt::CustomDashLine.
When current line style is solid, it seems the custom dash line is not soid anymore and this generate glitches.

To avoid the problem, need to to check if style is solid or not before updating dash offset (update only if not solid).

In addition, the original commit only 'fixed' dash offset problem for subdivision but not for main grid division; this commit fix both (main & subdivision) grids lines.


(cherry picked from commit 5d5719abba4717019d2ed6491431672b108a0d98)

M  +13   -3    libs/ui/canvas/kis_grid_decoration.cpp

https://invent.kde.org/graphics/krita/-/commit/fca99898de4472ca2bd41498f568072fb1ef9349