Bug 163234 - some svg elements are displayed with some artifacts
Summary: some svg elements are displayed with some artifacts
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
25.2.0.0 alpha0+
Hardware: All Linux (All)
: medium normal
Assignee: Armin Le Grand (allotropia)
URL:
Whiteboard: target:25.2.0
Keywords: bibisectRequest, regression
Depends on:
Blocks: CairoSDPR
  Show dependency treegraph
 
Reported: 2024-10-01 12:02 UTC by Xisco Faulí
Modified: 2024-10-07 18:17 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
sample file (449 bytes, image/svg+xml)
2024-10-01 12:02 UTC, Xisco Faulí
Details
screenshot (20.44 KB, image/png)
2024-10-01 12:02 UTC, Xisco Faulí
Details
sample 2 (1.05 KB, image/svg+xml)
2024-10-01 17:34 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Xisco Faulí 2024-10-01 12:02:04 UTC
Created attachment 196816 [details]
sample file

Steps to reproduce:
1. Open attached document
2. Zoom in and out

-> See some artifacts on the right of the left circle. See screenshot

Reproduced in
Comment 1 Xisco Faulí 2024-10-01 12:02:16 UTC
Created attachment 196817 [details]
screenshot
Comment 2 Xisco Faulí 2024-10-01 12:04:58 UTC
Not reproducible with  DISABLE_SYSTEM_DEPENDENT_PRIMITIVE_RENDERER=1
Comment 3 m_a_riosv 2024-10-01 17:09:00 UTC
I can not reproducible
Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 0679a5cee16ae96c0d11e7d4fc1e59fb0f9cc591
CPU threads: 16; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: CL threaded
Comment 4 Xisco Faulí 2024-10-01 17:33:15 UTC
yes, this is linux only
Comment 5 Xisco Faulí 2024-10-01 17:34:41 UTC
Created attachment 196827 [details]
sample 2
Comment 6 raal 2024-10-01 17:38:04 UTC
Reproducible in some zoom factors

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 4787fd4fc86230893a6da309f45964116b3a67df
CPU threads: 4; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded

but not in Version: 7.6.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 6f227b0dd912d4c70a01eb3872fff15d52de543a
CPU threads: 4; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded
Comment 7 Armin Le Grand (allotropia) 2024-10-02 14:35:12 UTC
This is really strange - something with cairo's miter and miterLimit mode as it seems. The seen error is cairo trying to paint a miter line join at a closed polygon (?!?). I see that because when I set cairo_set_line_join to always use CAIRO_LINE_JOIN_ROUND it is gone. No line join should be created by cairo for a closed polygon...
Comment 8 Armin Le Grand (allotropia) 2024-10-02 14:44:54 UTC
I have found the following in canvas/source/cairo/cairo_canvashelper.cxx, thus in code not from CairoSDPR:

            // to correctly render closed curves, need to output first
            // point twice (so output one additional point)

And now try to understand it - seems someone already stumbled over that problem in the past...?
Comment 9 Armin Le Grand (allotropia) 2024-10-02 15:23:19 UTC
To see very well: Only left circle is needed (have to change the SVG to do so), insert to a new draw, zoom in (is very small), select object (TAB) and move it with cursor keys while holding ALT (moves always one pixel independent of zoom level) -> you can see cairo trying/painting a bevel at the 3:00 position where the UnitCircle is closed at...
Comment 10 Armin Le Grand (allotropia) 2024-10-02 15:29:21 UTC
Very interesting: You can 'Break' the graphic -> get a fat line with the same problem. You can then set in dlg 'Line...' CornerStyle away from Mitered -> problem disappears.
You can also do the other way around: Start with empty draw, create e.g. 'Ellipse' from the tools, disable fill, make line fat, set CornerStlye to Mitered -> shows the error...
Comment 11 Armin Le Grand (allotropia) 2024-10-03 09:55:00 UTC
Ah - found it. It's the pixel snap. It was missing for control points (I had a comment there that this may be needed :-) and was done for too many cases. Adapted and took the chance to simplify some stuff.
Comment 12 Commit Notification 2024-10-03 12:27:28 UTC
Armin Le Grand (Collabora) committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c92846d670ba5c7f3a7abbced8e88fd214c87ca2

tdf#163234: CairoSDPR: PixelSnap corrections

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Xisco Faulí 2024-10-07 14:31:34 UTC
Verified in

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: ff3791f67a6421d64f5f9d6a09feaead1a63ff92
CPU threads: 8; OS: Linux 6.1; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded

@Armin, should this issue be closed a RESOLVED FIXED ?