Bug 142014 - [EMF] Path with PolylineTo + StrokeAndFill = wrong pen width for a stroke
Summary: [EMF] Path with PolylineTo + StrokeAndFill = wrong pen width for a stroke
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Bartosz
URL:
Whiteboard: target:7.2.0 target:7.1.4
Keywords:
: 112603 (view as bug list)
Depends on:
Blocks: EMF-WMF
  Show dependency treegraph
 
Reported: 2021-05-01 12:04 UTC by Valek Filippov
Modified: 2021-05-21 17:01 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
EMF sample with Path/PolylineTo/StrokeAndFill (332 bytes, image/emf)
2021-05-01 12:05 UTC, Valek Filippov
Details
Screenshot for the attached sample opened in MSO (7.94 KB, image/png)
2021-05-01 12:06 UTC, Valek Filippov
Details
Screenshot from LO (14.51 KB, image/png)
2021-05-01 12:09 UTC, Valek Filippov
Details
Screenshot for the attached sample opened in MSO win10 (1.86 KB, image/png)
2021-05-01 13:33 UTC, Valek Filippov
Details
EMF sample with PolylineTo and FillPath (332 bytes, image/x-emf)
2021-05-12 16:43 UTC, Valek Filippov
Details
Screenshot for PolylineTo+FillPath opened in MS Paint (1.85 KB, image/png)
2021-05-12 16:44 UTC, Valek Filippov
Details
EMF with two arcs, one with default pen, another with pen width=0 (PS_GEOMETRIC) (356 bytes, image/x-emf)
2021-05-13 14:08 UTC, Valek Filippov
Details
Screenshot with default and "w=0" pen from MS Paint (1.25 KB, image/png)
2021-05-13 14:15 UTC, Valek Filippov
Details
Comparison LibreOffice 7.1 (KO), LibreOffice 7.2 master (OK) and MSO 2010 (12.75 KB, image/png)
2021-05-17 15:22 UTC, Xisco Faulí
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Valek Filippov 2021-05-01 12:04:12 UTC
Description:
LO draws proper PolylineTo as part of the path if StrokePath is applied. However, if StrokeAndFill is applied, LO uses very thin stroke.

Steps to Reproduce:
Open attached EMF sample.

Actual Results:
Thin stroke around triangle

Expected Results:
Thick stroke around triangle.


Reproducible: Always


User Profile Reset: No



Additional Info:
To be continued...
Comment 1 Valek Filippov 2021-05-01 12:05:07 UTC
Created attachment 171558 [details]
EMF sample with Path/PolylineTo/StrokeAndFill
Comment 2 Valek Filippov 2021-05-01 12:06:12 UTC
Created attachment 171559 [details]
Screenshot for the attached sample opened in MSO
Comment 3 Valek Filippov 2021-05-01 12:09:02 UTC
Created attachment 171560 [details]
Screenshot from LO

This screenshot shows two files: with 'StrokePath' and with 'StrokeAndFillPath'.
Stroke around filled shape should be as thick as on the non-filled one.
Comment 4 Valek Filippov 2021-05-01 13:33:46 UTC
Created attachment 171566 [details]
Screenshot for the attached sample opened in MSO win10

Looks like MSO on Mac doesn't do it properly too.
[MS-EMF] claims that:
'The EMR_STROKEANDFILLPATH record closes any open figures in a path, strokes the outline of the path by using the current pen, and fills its interior by using the current brush.'
However, it looks like it first strokes, then closes and fills.

There is no stroke on the bottom left side of the triangle in windows implementation.
Comment 5 Roman Kuznetsov 2021-05-03 13:47:03 UTC
confirm in

Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: a52590d76b89dc75be2aa87f4287624c89f1e82f
CPU threads: 4; OS: Mac OS X 11.3; UI render: default; VCL: osx
Locale: ru-RU (ru_RU.UTF-8); UI: en-US
Calc: threaded
Comment 6 Valek Filippov 2021-05-12 16:43:19 UTC
Created attachment 171926 [details]
EMF sample with PolylineTo and FillPath

As per Bartosz request
Comment 7 Valek Filippov 2021-05-12 16:44:44 UTC
Created attachment 171927 [details]
Screenshot for PolylineTo+FillPath opened in MS Paint
Comment 8 Bartosz 2021-05-12 16:57:31 UTC
*** Bug 112603 has been marked as a duplicate of this bug. ***
Comment 9 Commit Notification 2021-05-12 18:33:08 UTC
Bartosz Kosiorek committed a patch related to this issue.
It has been pushed to "master":

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

tdf#112603 tdf#142014 tdf#142139 WMF/EMF Fix line width

It will be available in 7.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 10 Commit Notification 2021-05-12 20:25:22 UTC
Bartosz Kosiorek committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

https://git.libreoffice.org/core/commit/3ffc0afce0f26900a4e1d9feed2c21108e1ed41b

tdf#112603 tdf#142014 tdf#142139 WMF/EMF Fix line width

It will be available in 7.1.4.

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 11 Valek Filippov 2021-05-13 14:08:27 UTC
Created attachment 171961 [details]
EMF with two arcs, one with default pen, another with pen width=0 (PS_GEOMETRIC)

As per Bartosz request
Comment 12 Valek Filippov 2021-05-13 14:15:37 UTC
Created attachment 171962 [details]
Screenshot with default and "w=0" pen from MS Paint

Smaller arc has pen with width=0. Probably it shouldn't be displayed.
Comment 13 Commit Notification 2021-05-13 20:00:23 UTC
Bartosz Kosiorek committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/699295ca7cab3a4f4e801a14496f202c05d18899

tdf#142014 Fix displaying strokes when line width is 0

It will be available in 7.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 14 Commit Notification 2021-05-14 07:12:11 UTC
Bartosz Kosiorek committed a patch related to this issue.
It has been pushed to "libreoffice-7-1":

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

tdf#142014 Fix displaying strokes when line width is 0

It will be available in 7.1.4.

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 15 Xisco Faulí 2021-05-17 15:22:08 UTC
Created attachment 172093 [details]
Comparison LibreOffice 7.1 (KO), LibreOffice 7.2 master (OK) and  MSO 2010
Comment 16 Xisco Faulí 2021-05-17 15:22:34 UTC
Verified in

Version: 7.2.0.0.alpha1+ / LibreOffice Community
Build ID: c781776f3c79bbe3175b1452d26c79ebb931a500
CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

@Bartosz, thanks for fixing this issue. Should it be closed as RESOLVED FIXED ?