avoid floating-point error with empty bitmaps.

Change-Id: I11be81b52e32c776905a6caac1582cd1a839ab24
This commit is contained in:
Michael Meeks
2013-03-20 17:43:58 +00:00
parent e9249e4f01
commit ba4e2aad3e

View File

@@ -153,6 +153,9 @@ void PresenterCanvasHelper::PaintTiledBitmap (
// Tile the bitmap over the repaint box.
const geometry::IntegerSize2D aBitmapSize (rxTexture->getSize());
if( aBitmapSize.Width < 1 || aBitmapSize.Height < 1)
return;
const sal_Int32 nLeft = (rRepaintBox.X / aBitmapSize.Width) * aBitmapSize.Width;
const sal_Int32 nTop = (rRepaintBox.Y / aBitmapSize.Height) * aBitmapSize.Height;
const sal_Int32 nRight = ((rRepaintBox.X + rRepaintBox.Width - 1 + aBitmapSize.Width - 1)