Bug 161833

Summary: Wrap > Contour clips semi-transparent shadow
Product: LibreOffice Reporter: Patrick Luby (volunteer) <guibomacdev>
Component: WriterAssignee: Patrick Luby (volunteer) <guibomacdev>
Status: ASSIGNED ---    
Severity: normal CC: mikekaganski, noelgrandin
Priority: medium    
Version: 7.6.7.2 release   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=158166
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: Image with semi-transparent shadow pixels are clipped when Wrap > Contour context menu is checked
Top half is snapshot of Microsoft Word and bottom half is snapshot of LibreOffice nightly build

Description Patrick Luby (volunteer) 2024-06-28 22:20:31 UTC
Created attachment 195046 [details]
Image with semi-transparent shadow pixels are clipped when Wrap > Contour context menu is checked

While testing my fix for tdf#161498 with the following, I noticed that since at least LibreOffice 7.6.7, the semi-transparent shadow that surrounds the opaque part of the following image is treated as fully transparent when the image is put within a paragraph in a Writer document and Wrap > Contour is selected from the context menu.

To reproduce this bug, open Writer in a build that has the fix for tdf#161498 and then open the attached sample document. Scroll down to the image half-way down the first page and note that the image has a jagged outer edge and the text is laid out very close to the image edge.

Then, right-click or Command-click on the image and uncheck Wrap > Contour. Note that the unwrapped image has a gray shadow around the edge. In Microsoft Word on macOS, opening the attached sample document shows the gray shadow and the text is laid out to make room for the shadow.

Interestingly, opening the attached sample document in NeoOffice 2022.7 (which is based on LibreOffice 4.4) looks similar to Microsoft Word so this used to work in LibreOffice at some point in the past.
Comment 1 Patrick Luby (volunteer) 2024-06-28 22:22:29 UTC
Created attachment 195047 [details]
Top half is snapshot of Microsoft Word and bottom half is snapshot of LibreOffice nightly build
Comment 2 Patrick Luby (volunteer) 2024-06-28 22:24:14 UTC
(In reply to Patrick Luby (volunteer) from comment #1)
> Created attachment 195047 [details]
> Top half is snapshot of Microsoft Word and bottom half is snapshot of
> LibreOffice nightly build

Correction: the top half is after I uncheck contour wrapping but even with contour wrapping, I see the shadow in Microsoft Word.
Comment 3 Patrick Luby (volunteer) 2024-06-28 22:44:25 UTC
I have submitted the following patch that fixes this bug:

https://gerrit.libreoffice.org/c/core/+/169745

Note that when a document is first loaded, Writer appears to use a contour wrapped polygon saved within the document and the user must uncheck Wrap > Contour, and then check it again before Writer will recalculate the contour wrapping polygon.

Not sure if this is what we want or not. For comparison, Microsoft Word on macOS recalculates the contour wrapping polygon when the document is loaded so this bug never appears in Word with the attached sample document.