diff options
author | Patrick Luby <guibmacdev@gmail.com> | 2024-06-28 18:31:14 -0400 |
---|---|---|
committer | Patrick Luby <guibomacdev@gmail.com> | 2024-07-04 15:18:23 +0200 |
commit | 9acb4d4605411c308c8e064b4a4855615046c7f1 (patch) | |
tree | 99e3241e67d2ef386c8ad2455b34c3d05a5a65c5 /xmloff | |
parent | bcd8235411f72d7cc7fa05527ccf357a4dc23ffa (diff) |
tdf#161833 treat semi-transparent pixels as opaque
Limiting the contour wrapping polygon to only opaque pixels
causes clipping of any shadows or other semi-transaprent
areas in the image. So, instead of testing for fully opaque
pixels, treat pixels that are not fully transparent as opaque.
Also, tdf#161833 would cause semi-transparent pixels to be
treated as fully transparent pixels when calculating the wrap
contour for an image. To force the correct contour when loading
a document, force the contour to be recalculated by ignoring
the saved polygon if the contour is set to "recreate on edit".
Change-Id: Ibe256f54e1c82de30c2b7d5b92a69344b4a7ba10
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169745
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
(cherry picked from commit 3da1d8a791cff6cf2dad29b64c9ad15b1a65d5b3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169955
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/text/XMLTextFrameContext.cxx | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/xmloff/source/text/XMLTextFrameContext.cxx b/xmloff/source/text/XMLTextFrameContext.cxx index 87752f73b199..5c293c7670c2 100644 --- a/xmloff/source/text/XMLTextFrameContext.cxx +++ b/xmloff/source/text/XMLTextFrameContext.cxx @@ -271,17 +271,26 @@ XMLTextFrameContourContext_Impl::XMLTextFrameContourContext_Impl( const SdXMLImExViewBox aViewBox( sViewBox, GetImport().GetMM100UnitConverter()); basegfx::B2DPolyPolygon aPolyPolygon; - if( bPath ) + // Related tdf#161833: ignore saved polygon for "recreate on edit" contours + // tdf#161833 would cause semi-transparent pixels to be treated as fully + // transparent pixels when calculating the wrap contour for an image. To + // force the correct contour when loading a document, force the contour + // to be recalculated by ignoring the saved polygon if the contour is set + // to "recreate on edit". + if( !bAuto ) { - basegfx::utils::importFromSvgD(aPolyPolygon, sD, GetImport().needFixPositionAfterZ(), nullptr); - } - else - { - basegfx::B2DPolygon aPolygon; - - if(basegfx::utils::importFromSvgPoints(aPolygon, sPoints)) + if( bPath ) { - aPolyPolygon = basegfx::B2DPolyPolygon(aPolygon); + basegfx::utils::importFromSvgD(aPolyPolygon, sD, GetImport().needFixPositionAfterZ(), nullptr); + } + else + { + basegfx::B2DPolygon aPolygon; + + if(basegfx::utils::importFromSvgPoints(aPolygon, sPoints)) + { + aPolyPolygon = basegfx::B2DPolyPolygon(aPolygon); + } } } |