diff options
author | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-04-10 16:20:09 +0200 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2024-04-10 17:42:03 +0200 |
commit | e1f3120ce83c113d7dc91b60f50344f63f1c41f0 (patch) | |
tree | 680d1e16a73f1ea8d0a895dd5e5b0b2b6113d717 /vcl | |
parent | fe66cf8c8048bfd8a4386c0c711bd6912af9ec63 (diff) |
vcl: return earlier if size is empty
Change-Id: I96bcd47d93e0e4d05e33d3ad3eca86c6edcf87ac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165950
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/bitmap/BitmapTools.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/vcl/source/bitmap/BitmapTools.cxx b/vcl/source/bitmap/BitmapTools.cxx index ee0134a90010..2330483bb98b 100644 --- a/vcl/source/bitmap/BitmapTools.cxx +++ b/vcl/source/bitmap/BitmapTools.cxx @@ -376,6 +376,12 @@ BitmapEx CanvasTransformBitmap( const BitmapEx& rBitmap, ::basegfx::B2DRectangle const & rDestRect, ::basegfx::B2DHomMatrix const & rLocalTransform ) { + const Size aDestBmpSize( ::basegfx::fround( rDestRect.getWidth() ), + ::basegfx::fround( rDestRect.getHeight() ) ); + + if( aDestBmpSize.IsEmpty() ) + return BitmapEx(); + const Size aBmpSize( rBitmap.GetSizePixel() ); Bitmap aSrcBitmap( rBitmap.GetBitmap() ); Bitmap aSrcAlpha; @@ -416,12 +422,6 @@ BitmapEx CanvasTransformBitmap( const BitmapEx& rBitmap, } // else: mapping table is not used - const Size aDestBmpSize( ::basegfx::fround( rDestRect.getWidth() ), - ::basegfx::fround( rDestRect.getHeight() ) ); - - if( aDestBmpSize.IsEmpty() ) - return BitmapEx(); - Bitmap aDstBitmap(aDestBmpSize, aSrcBitmap.getPixelFormat(), &pReadAccess->GetPalette()); Bitmap aDstAlpha( AlphaMask( aDestBmpSize ).GetBitmap() ); |