diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2022-08-31 17:22:08 +0200 |
---|---|---|
committer | Aron Budea <aron.budea@collabora.com> | 2022-09-09 16:16:29 +0200 |
commit | a87c924aa2bca718ff93e17c03e4d03e58ba8a89 (patch) | |
tree | 7e062679f3c9e7672e34d5b8bf4c969f26fdff7a | |
parent | dc961a90d6bddffff513021060617a94407c5c26 (diff) |
fix limiting drawing of softedge effect (tdf#141981)
Apparently an empty viewport actually means everything should be drawn.
Change-Id: I55ae453a8f264d48222ade48a2953ab7d97c7f79
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138991
Tested-by: Jenkins
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 6a57652cfc2e46a271091246cd867804c39f845c)
-rw-r--r-- | drawinglayer/source/processor2d/vclpixelprocessor2d.cxx | 6 | ||||
-rw-r--r-- | include/drawinglayer/geometry/viewinformation2d.hxx | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx index 5e6c6a73cd60..526e8a9c3ad0 100644 --- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx @@ -1050,7 +1050,8 @@ void VclPixelProcessor2D::processGlowPrimitive2D(const primitive2d::GlowPrimitiv // Limit the bitmap size to the visible area. basegfx::B2DRange viewRange(getViewInformation2D().getDiscreteViewport()); basegfx::B2DRange bitmapRange(aRange); - bitmapRange.intersect(viewRange); + if (!viewRange.isEmpty()) + bitmapRange.intersect(viewRange); if (!bitmapRange.isEmpty()) { const tools::Rectangle aRect( @@ -1112,7 +1113,8 @@ void VclPixelProcessor2D::processSoftEdgePrimitive2D( // Limit the bitmap size to the visible area. basegfx::B2DRange viewRange(getViewInformation2D().getDiscreteViewport()); basegfx::B2DRange bitmapRange(aRange); - bitmapRange.intersect(viewRange); + if (!viewRange.isEmpty()) + bitmapRange.intersect(viewRange); if (!bitmapRange.isEmpty()) { const tools::Rectangle aRect( diff --git a/include/drawinglayer/geometry/viewinformation2d.hxx b/include/drawinglayer/geometry/viewinformation2d.hxx index 95be29a72bda..33d02cd76ada 100644 --- a/include/drawinglayer/geometry/viewinformation2d.hxx +++ b/include/drawinglayer/geometry/viewinformation2d.hxx @@ -140,6 +140,7 @@ public: /// data access const basegfx::B2DHomMatrix& getObjectTransformation() const; const basegfx::B2DHomMatrix& getViewTransformation() const; + /// Empty viewport means everything is visible. const basegfx::B2DRange& getViewport() const; double getViewTime() const; const css::uno::Reference<css::drawing::XDrawPage>& getVisualizedPage() const; @@ -149,6 +150,7 @@ public: const basegfx::B2DHomMatrix& getInverseObjectToViewTransformation() const; /// On-demand prepared Viewport in discrete units for convenience + /// Empty viewport means everything is visible. const basegfx::B2DRange& getDiscreteViewport() const; /** support reduced DisplayQuality, PropertyName is 'ReducedDisplayQuality'. This |