Bug 142261 - [EMF/EMF+] SetMiterLimit support
Summary: [EMF/EMF+] SetMiterLimit support
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: graphics stack (show other bugs)
Version:
(earliest affected)
7.2.0.0.alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:7.4.0
Keywords:
Depends on:
Blocks: EMF-WMF
  Show dependency treegraph
 
Reported: 2021-05-13 18:01 UTC by Valek Filippov
Modified: 2024-05-13 03:15 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
EMF sample with SetMiterLimit 2 and SetMiterLimit 20 (340 bytes, image/x-emf)
2021-05-13 18:02 UTC, Valek Filippov
Details
Screenshot of the sample EMF file opened in MS Paint (4.83 KB, image/png)
2021-05-13 18:04 UTC, Valek Filippov
Details
How it looks in LO 7.2 master from May 11, 2021 (1.72 KB, image/png)
2021-05-13 18:05 UTC, Valek Filippov
Details
EMF+ with different Line Joints and different Line Miter Minimum Angles (51.42 KB, image/emf)
2022-05-12 11:52 UTC, Bartosz
Details
EMF+ This is how it should looks like (MS Paint) (607.67 KB, image/png)
2022-05-12 11:53 UTC, Bartosz
Details
EMF with different Line Joints and different Line Miter Minimum Angles (2.84 KB, image/emf)
2022-05-13 21:19 UTC, Bartosz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Valek Filippov 2021-05-13 18:01:02 UTC
Description:
LO doesn't support SetMiterLimit

Steps to Reproduce:
Open attached EMF sample

Actual Results:
LO bevels both joins

Expected Results:
Only join of the left shape should be beveled


Reproducible: Always


User Profile Reset: No



Additional Info:
Probably more samples with different miter values would be required to figure out the right behavior.
Comment 1 Valek Filippov 2021-05-13 18:02:05 UTC
Created attachment 171970 [details]
EMF sample with SetMiterLimit 2 and SetMiterLimit 20
Comment 2 Valek Filippov 2021-05-13 18:04:40 UTC
Created attachment 171971 [details]
Screenshot of the sample EMF file opened in MS Paint
Comment 3 Valek Filippov 2021-05-13 18:05:05 UTC
Created attachment 171972 [details]
How it looks in LO 7.2 master from May 11, 2021
Comment 4 Roman Kuznetsov 2021-05-22 17:52:24 UTC
confirm in

Version: 7.2.0.0.alpha1+ / LibreOffice Community
Build ID: 128f67e0efa02294205a1abe1be874557ecdcecd
CPU threads: 4; OS: Linux 5.5; UI render: default; VCL: kf5 (cairo+xcb)
Locale: ru-RU (ru_RU.UTF-8); UI: ru-RU
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2021-05-19_06:21:05
Calc: threaded
Comment 5 Bartosz 2022-04-20 07:22:52 UTC
More information about miter is available at:
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/stroke-miterlimit

https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-emfplus/5ef071f3-f503-4f16-b027-7c4bcf2d1d81

https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-emf/2637d0d0-92dd-48e8-be5e-6400b4d1fc5e

In vcl/win/gdi/gdiimpl.cxx there is an mehod which translate miterangle to miterlimit:

        case basegfx::B2DLineJoin::Miter :
        {
            const Gdiplus::REAL aMiterLimit(1.0/sin(fMiterMinimumAngle/2.0));

            aPen.SetMiterLimit(aMiterLimit);
            // tdf#99165 MS's LineJoinMiter creates non standard conform miter additional
            // graphics, somewhere clipped in some distance from the edge point, dependent
            // of MiterLimit. The more default-like option is LineJoinMiterClipped, so use
            // that instead
            aPen.SetLineJoin(Gdiplus::LineJoinMiterClipped);
            break;
        }
Comment 6 Bartosz 2022-05-12 11:52:36 UTC
Created attachment 180074 [details]
EMF+ with different Line Joints and different Line Miter Minimum Angles
Comment 7 Bartosz 2022-05-12 11:53:10 UTC
Created attachment 180075 [details]
EMF+ This is how it should looks like (MS Paint)
Comment 8 Commit Notification 2022-05-13 11:50:18 UTC
Bartosz Kosiorek committed a patch related to this issue.
It has been pushed to "master":

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

tdf#142261 EMF+ Add support for Miter Limit

It will be available in 7.4.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 9 Bartosz 2022-05-13 21:19:10 UTC
Created attachment 180109 [details]
EMF with different Line Joints and different Line Miter Minimum Angles
Comment 10 QA Administrators 2024-05-13 03:15:31 UTC
Dear Valek Filippov,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug