summaryrefslogtreecommitdiff
path: root/svgio/source
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2024-04-22 15:30:05 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2024-04-22 17:38:15 +0200
commit1097686ebddd48b78816d87524caadd17b788c23 (patch)
tree829660cdf95b628e3c8ed037d353466e53458482 /svgio/source
parentaf9ae41d6766d9103199f7c41380789ee7740224 (diff)
tdf#160782: convert to bitmapEx from 0,0 to width,height
This is the way it's done everywhere. Partially revert 4b6e0f2c88debaedb514c868e061c21e15215b6e "tdf#160726, tdf#48062: Simplify how BitmapExs are created" Change-Id: I15fea0b6855a65da7cb48b24fc00ba303e33dcf8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166456 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'svgio/source')
-rw-r--r--svgio/source/svgreader/svgfeblendnode.cxx24
-rw-r--r--svgio/source/svgreader/svgfecompositenode.cxx24
2 files changed, 20 insertions, 28 deletions
diff --git a/svgio/source/svgreader/svgfeblendnode.cxx b/svgio/source/svgreader/svgfeblendnode.cxx
index af6406ebf58b..a5109aa24fe6 100644
--- a/svgio/source/svgreader/svgfeblendnode.cxx
+++ b/svgio/source/svgreader/svgfeblendnode.cxx
@@ -134,12 +134,8 @@ void SvgFeBlendNode::apply(drawinglayer::primitive2d::Primitive2DContainer& rTar
aRange2 = pSource2->getB2DRange(aViewInformation2D);
}
- const sal_Int32 nX1 = std::min(aRange.getMinX(), aRange2.getMinX());
- const sal_Int32 nY1 = std::min(aRange.getMinY(), aRange2.getMinY());
- const sal_Int32 nX2 = std::max(aRange.getMaxX(), aRange2.getMaxX());
- const sal_Int32 nY2 = std::max(aRange.getMaxY(), aRange2.getMaxY());
-
- const basegfx::B2DRange aBaseRange(nX1, nY1, nX1 + nX2, nY1 + nY2);
+ const basegfx::B2DRange aBaseRange(0, 0, std::max(aRange.getMaxX(), aRange2.getMaxX()),
+ std::max(aRange.getMaxY(), aRange2.getMaxY()));
BitmapEx aBmpEx, aBmpEx2;
@@ -147,28 +143,28 @@ void SvgFeBlendNode::apply(drawinglayer::primitive2d::Primitive2DContainer& rTar
{
drawinglayer::primitive2d::Primitive2DContainer aSource(*pSource);
aBmpEx = drawinglayer::convertToBitmapEx(
- std::move(aSource), aViewInformation2D, aBaseRange,
- aBaseRange.getWidth() * aBaseRange.getHeight());
+ std::move(aSource), aViewInformation2D, aBaseRange.getWidth(),
+ aBaseRange.getHeight(), aBaseRange.getWidth() * aBaseRange.getHeight());
}
else
{
aBmpEx = drawinglayer::convertToBitmapEx(
- std::move(rTarget), aViewInformation2D, aBaseRange,
- aBaseRange.getWidth() * aBaseRange.getHeight());
+ std::move(rTarget), aViewInformation2D, aBaseRange.getWidth(),
+ aBaseRange.getHeight(), aBaseRange.getWidth() * aBaseRange.getHeight());
}
if (pSource2)
{
drawinglayer::primitive2d::Primitive2DContainer aSource(*pSource2);
aBmpEx2 = drawinglayer::convertToBitmapEx(
- std::move(aSource), aViewInformation2D, aBaseRange,
- aBaseRange.getWidth() * aBaseRange.getHeight());
+ std::move(aSource), aViewInformation2D, aBaseRange.getWidth(),
+ aBaseRange.getHeight(), aBaseRange.getWidth() * aBaseRange.getHeight());
}
else
{
aBmpEx2 = drawinglayer::convertToBitmapEx(
- std::move(rTarget), aViewInformation2D, aBaseRange,
- aBaseRange.getWidth() * aBaseRange.getHeight());
+ std::move(rTarget), aViewInformation2D, aBaseRange.getWidth(),
+ aBaseRange.getHeight(), aBaseRange.getWidth() * aBaseRange.getHeight());
}
BitmapEx aResBmpEx;
diff --git a/svgio/source/svgreader/svgfecompositenode.cxx b/svgio/source/svgreader/svgfecompositenode.cxx
index 91364363ca22..0dea908847f6 100644
--- a/svgio/source/svgreader/svgfecompositenode.cxx
+++ b/svgio/source/svgreader/svgfecompositenode.cxx
@@ -223,12 +223,8 @@ void SvgFeCompositeNode::apply(drawinglayer::primitive2d::Primitive2DContainer&
aRange2 = pSource2->getB2DRange(aViewInformation2D);
}
- const sal_uInt32 nX1 = std::min(aRange.getMinX(), aRange2.getMinX());
- const sal_uInt32 nY1 = std::min(aRange.getMinY(), aRange2.getMinY());
- const sal_uInt32 nX2 = std::max(aRange.getMaxX(), aRange2.getMaxX());
- const sal_uInt32 nY2 = std::max(aRange.getMaxY(), aRange2.getMaxY());
-
- const basegfx::B2DRange aBaseRange(nX1, nY1, nX1 + nX2, nY1 + nY2);
+ const basegfx::B2DRange aBaseRange(0, 0, std::max(aRange.getMaxX(), aRange2.getMaxX()),
+ std::max(aRange.getMaxY(), aRange2.getMaxY()));
BitmapEx aBmpEx, aBmpEx2;
@@ -236,28 +232,28 @@ void SvgFeCompositeNode::apply(drawinglayer::primitive2d::Primitive2DContainer&
{
drawinglayer::primitive2d::Primitive2DContainer aSource(*pSource);
aBmpEx = drawinglayer::convertToBitmapEx(
- std::move(aSource), aViewInformation2D, aBaseRange,
- aBaseRange.getWidth() * aBaseRange.getHeight());
+ std::move(aSource), aViewInformation2D, aBaseRange.getWidth(),
+ aBaseRange.getHeight(), aBaseRange.getWidth() * aBaseRange.getHeight());
}
else
{
aBmpEx = drawinglayer::convertToBitmapEx(
- std::move(rTarget), aViewInformation2D, aBaseRange,
- aBaseRange.getWidth() * aBaseRange.getHeight());
+ std::move(rTarget), aViewInformation2D, aBaseRange.getWidth(),
+ aBaseRange.getHeight(), aBaseRange.getWidth() * aBaseRange.getHeight());
}
if (pSource2)
{
drawinglayer::primitive2d::Primitive2DContainer aSource(*pSource2);
aBmpEx2 = drawinglayer::convertToBitmapEx(
- std::move(aSource), aViewInformation2D, aBaseRange,
- aBaseRange.getWidth() * aBaseRange.getHeight());
+ std::move(aSource), aViewInformation2D, aBaseRange.getWidth(),
+ aBaseRange.getHeight(), aBaseRange.getWidth() * aBaseRange.getHeight());
}
else
{
aBmpEx2 = drawinglayer::convertToBitmapEx(
- std::move(rTarget), aViewInformation2D, aBaseRange,
- aBaseRange.getWidth() * aBaseRange.getHeight());
+ std::move(rTarget), aViewInformation2D, aBaseRange.getWidth(),
+ aBaseRange.getHeight(), aBaseRange.getWidth() * aBaseRange.getHeight());
}
BitmapArithmeticBlendFilter aArithmeticFilter(aBmpEx, aBmpEx2);