drawinglayer/source/primitive2d/Tools.cxx | 6 ++++++ drawinglayer/source/primitive2d/glowprimitive2d.cxx | 9 +++++++++ drawinglayer/source/primitive2d/softedgeprimitive2d.cxx | 9 +++++++++ 3 files changed, 24 insertions(+)
New commits: commit 7207e46264b464711874fb6da0f9249cb4cf334c Author: Armin Le Grand (allotropia) <armin.le.grand.ext...@allotropia.de> AuthorDate: Wed Dec 21 16:04:04 2022 +0100 Commit: Armin Le Grand <armin.le.gr...@me.com> CommitDate: Thu Dec 22 10:17:06 2022 +0000 Added names for new Primitives to idToString (II) Change-Id: I43aa64afdd6b92beddc8484daa97babf4d6a6745 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144690 Tested-by: Jenkins Reviewed-by: Armin Le Grand <armin.le.gr...@me.com> diff --git a/drawinglayer/source/primitive2d/Tools.cxx b/drawinglayer/source/primitive2d/Tools.cxx index 6a3482319963..9c09ef24ee0c 100644 --- a/drawinglayer/source/primitive2d/Tools.cxx +++ b/drawinglayer/source/primitive2d/Tools.cxx @@ -225,6 +225,12 @@ OUString idToString(sal_uInt32 nId) return "GLOWPRIMITIVE"; case PRIMITIVE2D_ID_SOFTEDGEPRIMITIVE2D: return "SOFTEDGEPRIMITIVE"; + case PRIMITIVE2D_ID_LINERECTANGLEPRIMITIVE2D: + return "LINERECTANGLEPRIMITIVE"; + case PRIMITIVE2D_ID_FILLEDRECTANGLEPRIMITIVE2D: + return "FILLEDRECTANGLEPRIMITIVE"; + case PRIMITIVE2D_ID_SINGLELINEPRIMITIVE2D: + return "SINGLELINEPRIMITIVE"; default: return OUString::number((nId >> 16) & 0xFF) + "|" + OUString::number(nId & 0xFF); } commit a31dd1e645b1b330e79291218e8ee0fbdd5b99eb Author: Armin Le Grand (allotropia) <armin.le.grand.ext...@allotropia.de> AuthorDate: Wed Dec 21 17:52:18 2022 +0100 Commit: Armin Le Grand <armin.le.gr...@me.com> CommitDate: Thu Dec 22 10:16:54 2022 +0000 Corrected errors when Blur effect was re-used in shadow For GlowPrimitive2D and SoftEdgePrimitive2D I had to correct the view-dependent decomposition in the case where shadow was activated for the shape that was used. That creates an extra transformation, e.g. shadow offset, that needs to be taken into account, here by operating in discrete view- coordinates to solve the problem. NOTE: This is not needed for ShadowPrimitive2D itself when ShadowBlur is used due to the primitives this is based on are already handled with the needed offset. Change-Id: I87dd8db9467fbd27008d6154b78599f28057ce45 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144693 Tested-by: Jenkins Reviewed-by: Armin Le Grand <armin.le.gr...@me.com> diff --git a/drawinglayer/source/primitive2d/glowprimitive2d.cxx b/drawinglayer/source/primitive2d/glowprimitive2d.cxx index 47103ac9a011..8504b1a902a8 100644 --- a/drawinglayer/source/primitive2d/glowprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/glowprimitive2d.cxx @@ -96,6 +96,12 @@ bool GlowPrimitive2D::prepareValuesAndcheckValidity( basegfx::B2DRange aVisibleArea(rViewInformation.getViewport()); aVisibleArea.grow(getGlowRadius()); + // To do this correctly, it needs to be done in discrete coordinates. + // The object may be transformed relative to the original# + // ObjectTransformation, e.g. when re-used in shadow + aVisibleArea.transform(rViewInformation.getViewTransformation()); + rClippedRange.transform(rViewInformation.getObjectToViewTransformation()); + // calculate ClippedRange rClippedRange.intersect(aVisibleArea); @@ -103,6 +109,9 @@ bool GlowPrimitive2D::prepareValuesAndcheckValidity( // will be empty and we are done if (rClippedRange.isEmpty()) return false; + + // convert result back to object coordinates + rClippedRange.transform(rViewInformation.getInverseObjectToViewTransformation()); } // calculate discrete pixel size of GlowRange. If it's too small to visualize, we are done diff --git a/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx b/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx index e4cbb0d58a4f..ef34f0eb40e1 100644 --- a/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/softedgeprimitive2d.cxx @@ -88,6 +88,12 @@ bool SoftEdgePrimitive2D::prepareValuesAndcheckValidity( basegfx::B2DRange aVisibleArea(rViewInformation.getViewport()); aVisibleArea.grow(getRadius() * 2); + // To do this correctly, it needs to be done in discrete coordinates. + // The object may be transformed relative to the original# + // ObjectTransformation, e.g. when re-used in shadow + aVisibleArea.transform(rViewInformation.getViewTransformation()); + rClippedRange.transform(rViewInformation.getObjectToViewTransformation()); + // calculate ClippedRange rClippedRange.intersect(aVisibleArea); @@ -95,6 +101,9 @@ bool SoftEdgePrimitive2D::prepareValuesAndcheckValidity( // will be empty and we are done if (rClippedRange.isEmpty()) return false; + + // convert result back to object coordinates + rClippedRange.transform(rViewInformation.getInverseObjectToViewTransformation()); } // calculate discrete pixel size of SoftRange. If it's too small to visualize, we are done