basebmp/source/bitmapdevice.cxx | 20 ++++++++++++++++++-- vcl/headless/svpgdi.cxx | 6 +++++- 2 files changed, 23 insertions(+), 3 deletions(-)
New commits: commit 05ad682e73fb4b654056d7d5c49a7ac2dca4b10a Author: Caolán McNamara <caol...@redhat.com> Date: Mon Mar 23 16:05:17 2015 +0000 SvpSalGraphics::drawRect needs to adjust the rect bounds for line drawing like X11SalGraphicsImpl::drawRect does now the focus borders in the layouts pane of impress update correctly as the border is added/removed as you pass the mouse over them with the gtk3 plugin Change-Id: I1f03065049c2aee2e3c28e7a16777e9b06e34c6e diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx index 49eff80..526d349 100644 --- a/vcl/headless/svpgdi.cxx +++ b/vcl/headless/svpgdi.cxx @@ -416,15 +416,19 @@ void SvpSalGraphics::drawRect( long nX, long nY, long nWidth, long nHeight ) { if ((m_bUseLineColor || m_bUseFillColor) && m_aDevice) { - basegfx::B2DPolygon aRect = basegfx::tools::createPolygonFromRect( basegfx::B2DRectangle( nX, nY, nX+nWidth, nY+nHeight ) ); ensureClip(); // FIXME: for ... if( m_bUseFillColor ) { + basegfx::B2DPolygon aRect = basegfx::tools::createPolygonFromRect( basegfx::B2DRectangle( nX, nY, nX+nWidth, nY+nHeight ) ); basegfx::B2DPolyPolygon aPolyPoly( aRect ); m_aDevice->fillPolyPolygon( aPolyPoly, m_aFillColor, m_aDrawMode, m_aClipMap ); } if( m_bUseLineColor ) + { + // need same -1 hack as X11SalGraphicsImpl::drawRect + basegfx::B2DPolygon aRect = basegfx::tools::createPolygonFromRect( basegfx::B2DRectangle( nX, nY, nX+nWidth-1, nY+nHeight-1 ) ); m_aDevice->drawPolygon( aRect, m_aLineColor, m_aDrawMode, m_aClipMap ); + } } dbgOut( m_aDevice ); } commit cbd48230bb3a90c4c485fa33123c6653234e02e9 Author: Caolán McNamara <caol...@redhat.com> Date: Mon Mar 23 16:02:51 2015 +0000 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 diff --git a/basebmp/source/bitmapdevice.cxx b/basebmp/source/bitmapdevice.cxx index cb25e09..117d814 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 >
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits