diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-03-23 16:02:51 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-03-23 16:35:59 +0000 |
commit | cbd48230bb3a90c4c485fa33123c6653234e02e9 (patch) | |
tree | 48aa946f1448a66db5188d221ecc05134a9ee3db /basebmp | |
parent | dffc47e401b5b051ff6e1576b6e0b1ce4c06d2ff (diff) |
drawing a vertical/horizontal line does not really damage 0 width/height areas
so follow the same logic as drawPixel which equally does not damage a 0
width and height point
Change-Id: Ie2c400caf1ad2e3a874f92c6f90f5f071f9c95e3
Diffstat (limited to 'basebmp')
-rw-r--r-- | basebmp/source/bitmapdevice.cxx | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/basebmp/source/bitmapdevice.cxx b/basebmp/source/bitmapdevice.cxx index cb25e0999383..117d8146b804 100644 --- a/basebmp/source/bitmapdevice.cxx +++ b/basebmp/source/bitmapdevice.cxx @@ -359,7 +359,7 @@ namespace void damagedPixel( const basegfx::B2IPoint& rDamagePoint ) const { - if( !mpDamage ) + if (!mpDamage) return; sal_Int32 nX(rDamagePoint.getX()); @@ -499,9 +499,25 @@ namespace col, begin, rawAcc ); + + if (!mpDamage) + return; + // TODO(P2): perhaps this needs pushing up the stack a bit // to make more complex polygons more efficient ... - damaged( basegfx::B2IBox( rPt1, rPt2 ) ); + basegfx::B2IBox aBounds(rPt1, rPt2 ); + + const basegfx::B2IPoint& rEnd = aBounds.getMaximum(); + + sal_Int32 nX(rEnd.getX()); + sal_Int32 nY(rEnd.getY()); + if (nX < SAL_MAX_INT32) + ++nX; + if (nY < SAL_MAX_INT32) + ++nY; + + basegfx::B2IBox aDamagedBox(aBounds.getMinimum(), basegfx::B2IPoint(nX, nY)); + damaged(aDamagedBox); } template< typename Iterator, typename Accessor, typename RawAcc > |