Kaydet (Commit) b8cf3355 authored tarafından Armin Le Grand's avatar Armin Le Grand

#121387# Corrected RenderBitmapPrimitive2D_GraphicManager to correctly handle…

#121387# Corrected RenderBitmapPrimitive2D_GraphicManager to correctly handle cases with combinations of mirroring and rotation, also changed VclProcessor2D::RenderBitmapPrimitive2D to use own bitmapEx renderer for these cases for better quality
üst e4ce9034
...@@ -74,12 +74,28 @@ namespace drawinglayer ...@@ -74,12 +74,28 @@ namespace drawinglayer
{ {
// if rotated, create the unrotated output rectangle for the GraphicManager paint // if rotated, create the unrotated output rectangle for the GraphicManager paint
// #118824# Caution! When mirrored, adapt transformation accordingly // #118824# Caution! When mirrored, adapt transformation accordingly
// #121387# Also need to adapt position when mirror and rotation is combined
if(bMirrorX || bMirrorY)
{
const basegfx::B2DHomMatrix aRot(basegfx::tools::createRotateB2DHomMatrix(fRotate));
if(bMirrorX)
{
aTranslate += aRot * basegfx::B2DVector(aScale.getX(), 0.0);
}
if(bMirrorY)
{
aTranslate += aRot * basegfx::B2DVector(0.0, aScale.getY());
}
}
const basegfx::B2DHomMatrix aSimpleObjectMatrix( const basegfx::B2DHomMatrix aSimpleObjectMatrix(
basegfx::tools::createScaleTranslateB2DHomMatrix( basegfx::tools::createScaleTranslateB2DHomMatrix(
fabs(aScale.getX()), fabs(aScale.getX()),
fabs(aScale.getY()), fabs(aScale.getY()),
bMirrorX ? aTranslate.getX() - fabs(aScale.getX()): aTranslate.getX(), aTranslate.getX(),
bMirrorY ? aTranslate.getY() - fabs(aScale.getY()): aTranslate.getY())); aTranslate.getY()));
aOutlineRange.transform(aSimpleObjectMatrix); aOutlineRange.transform(aSimpleObjectMatrix);
} }
......
...@@ -424,9 +424,14 @@ namespace drawinglayer ...@@ -424,9 +424,14 @@ namespace drawinglayer
double fRotate, fShearX; double fRotate, fShearX;
aLocalTransform.decompose(aScale, aTranslate, fRotate, fShearX); aLocalTransform.decompose(aScale, aTranslate, fRotate, fShearX);
if(!bForceUseOfOwnTransformer && basegfx::fTools::equalZero(fShearX)) // #121387# when mirrored and rotated, avoid the GraphicManager output which has low quality
const bool bRotated(basegfx::fTools::equalZero(fRotate));
const bool bSheared(basegfx::fTools::equalZero(fShearX));
const bool bMirroredAndRotated(bRotated && (aScale.getX() < 0.0 || aScale.getY() < 0.0));
if(!bForceUseOfOwnTransformer && !bSheared && !bMirroredAndRotated)
{ {
if(!bUseGraphicManager && basegfx::fTools::equalZero(fRotate)) if(!bUseGraphicManager && !bRotated)
{ {
RenderBitmapPrimitive2D_BitmapEx(*mpOutputDevice, aBitmapEx, aLocalTransform); RenderBitmapPrimitive2D_BitmapEx(*mpOutputDevice, aBitmapEx, aLocalTransform);
} }
...@@ -437,7 +442,7 @@ namespace drawinglayer ...@@ -437,7 +442,7 @@ namespace drawinglayer
} }
else else
{ {
if(!aBitmapEx.IsTransparent() && (!basegfx::fTools::equalZero(fShearX) || !basegfx::fTools::equalZero(fRotate))) if(!aBitmapEx.IsTransparent() && (bSheared || bRotated))
{ {
// parts will be uncovered, extend aBitmapEx with a mask bitmap // parts will be uncovered, extend aBitmapEx with a mask bitmap
const Bitmap aContent(aBitmapEx.GetBitmap()); const Bitmap aContent(aBitmapEx.GetBitmap());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment