summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorWerner Koerner <wk661lo@gmail.com>2012-12-13 21:38:02 +0100
committerMichael Stahl <mstahl@redhat.com>2012-12-17 23:10:57 +0100
commit5cb9fe63458558951f91ed1aaf6e90472dff9a28 (patch)
treeb34a1d84dab3fac4c11a0fdad02d9259dd3037b1 /svtools
parent335b76de4a75d75790ab74b6fe057619b4d46535 (diff)
fdo#58196 Viewing: Reenable mirroring for scaled-down images
commit I6feb744712956a92d6140d079dc3a85ee8511930 (Stepwise rebuild bitmap rendering from scratch to avoid rendering bugs) missed horizontal and vertical flipping for images scaled down by more than about 60%. Change-Id: I68241792d2b43edde33f478c998d447debd8fd13 Reviewed-on: https://gerrit.libreoffice.org/1332 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com> (cherry picked from commit 3d969a60852d505cfa02a6b3410d4461718138ba) Signed-off-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/graphic/grfmgr2.cxx14
1 files changed, 12 insertions, 2 deletions
diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx
index b99214417eb6..4aeccf991b66 100644
--- a/svtools/source/graphic/grfmgr2.cxx
+++ b/svtools/source/graphic/grfmgr2.cxx
@@ -436,7 +436,7 @@ sal_Bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAt
}
}
}
- else
+ else // scaleByAveraging
{
double aSumRed, aSumGreen, aSumBlue, aCount;
BitmapColor aColor;
@@ -452,6 +452,11 @@ sal_Bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAt
double aUnrotatedX = ( pCosX[ x ] - nSinY ) / 256.0;
double aUnrotatedY = ( pSinX[ x ] + nCosY ) / 256.0;
+ if ( bHMirr )
+ aUnrotatedX = aUnrotatedWidth - aUnrotatedX - 1;
+ if ( bVMirr )
+ aUnrotatedY = aUnrotatedHeight - aUnrotatedY - 1;
+
if( ( aUnrotatedX >= 0 ) && ( aUnrotatedX < aUnrotatedWidth ) &&
( aUnrotatedY >= 0 ) && ( aUnrotatedY < aUnrotatedHeight ) )
{
@@ -563,7 +568,7 @@ sal_Bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAt
}
}
}
- else
+ else // scaleByAveraging
{
const BitmapColor aTrans( pWriteAccess->GetBestMatchingColor( Color( COL_WHITE ) ) );
BitmapColor aResultColor( 0 );
@@ -580,6 +585,11 @@ sal_Bool ImplCreateRotatedScaled( const BitmapEx& rBmpEx, const GraphicAttr& rAt
double aUnrotatedX = ( pCosX[ x ] - nSinY ) / 256.0;
double aUnrotatedY = ( pSinX[ x ] + nCosY ) / 256.0;
+ if ( bHMirr )
+ aUnrotatedX = aUnrotatedWidth - aUnrotatedX - 1;
+ if ( bVMirr )
+ aUnrotatedY = aUnrotatedHeight - aUnrotatedY - 1;
+
if( ( aUnrotatedX >= 0 ) && ( aUnrotatedX < aUnrotatedWidth ) &&
( aUnrotatedY >= 0 ) && ( aUnrotatedY < aUnrotatedHeight ) )
{