diff options
Diffstat (limited to 'extensions/source/scanner/grid.cxx')
-rw-r--r-- | extensions/source/scanner/grid.cxx | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/extensions/source/scanner/grid.cxx b/extensions/source/scanner/grid.cxx index 85f22fb017e7..110779c55080 100644 --- a/extensions/source/scanner/grid.cxx +++ b/extensions/source/scanner/grid.cxx @@ -523,32 +523,32 @@ void GridWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangl bool GridWindow::MouseMove( const MouseEvent& rEvt ) { - if( rEvt.GetButtons() == MOUSE_LEFT && m_nDragIndex != npos ) - { - Point aPoint( rEvt.GetPosPixel() ); + if( rEvt.GetButtons() != MOUSE_LEFT || m_nDragIndex == npos ) + return false; - if( m_nDragIndex == 0 || m_nDragIndex == m_aHandles.size() - 1) - { - aPoint.setX( m_aHandles[m_nDragIndex].maPos.X() ); - } - else - { - if(aPoint.X() < m_aGridArea.Left()) - aPoint.setX( m_aGridArea.Left() ); - else if(aPoint.X() > m_aGridArea.Right()) - aPoint.setX( m_aGridArea.Right() ); - } + Point aPoint( rEvt.GetPosPixel() ); + + if( m_nDragIndex == 0 || m_nDragIndex == m_aHandles.size() - 1) + { + aPoint.setX( m_aHandles[m_nDragIndex].maPos.X() ); + } + else + { + if(aPoint.X() < m_aGridArea.Left()) + aPoint.setX( m_aGridArea.Left() ); + else if(aPoint.X() > m_aGridArea.Right()) + aPoint.setX( m_aGridArea.Right() ); + } - if( aPoint.Y() < m_aGridArea.Top() ) - aPoint.setY( m_aGridArea.Top() ); - else if( aPoint.Y() > m_aGridArea.Bottom() ) - aPoint.setY( m_aGridArea.Bottom() ); + if( aPoint.Y() < m_aGridArea.Top() ) + aPoint.setY( m_aGridArea.Top() ); + else if( aPoint.Y() > m_aGridArea.Bottom() ) + aPoint.setY( m_aGridArea.Bottom() ); - if( aPoint != m_aHandles[m_nDragIndex].maPos ) - { - m_aHandles[m_nDragIndex].maPos = aPoint; - Invalidate( m_aGridArea ); - } + if( aPoint != m_aHandles[m_nDragIndex].maPos ) + { + m_aHandles[m_nDragIndex].maPos = aPoint; + Invalidate( m_aGridArea ); } return false; |