Commit 4f297e34 authored by Oliver Sander's avatar Oliver Sander Committed by Albert Astals Cid

Do not use slotChangeDrawingToolEngine to reset the drawingEngine

The previous code used two consecutive calls to the method
slotChangeDrawingToolEngine to reset the m_drawingEngine
member (i.e., to delete it and to create a new one from scratch).
That worked; however, as a side effect the calls to
slotChangeDrawingToolEngine also set the cursor to an arrow,
which happens every time one continuous stroke is finished.
This went unnoticed because when drawing in presentation mode
the cursor is an arrow anyway.  However, in anticipation
of future patches that change the cursor to a cross-hair
when drawing, this explicit setting of the arrow shape
needs to go.  Therefore this patch replaces the two calls
to slotChangeDrawingToolEngine by the code they contain,
minus the code to set the cursor shape. The new code is
only one line longer, and more readable too.
parent 7074bad2
...@@ -1369,11 +1369,11 @@ QRect PresentationWidget::routeMouseDrawingEvent( QMouseEvent * e ) ...@@ -1369,11 +1369,11 @@ QRect PresentationWidget::routeMouseDrawingEvent( QMouseEvent * e )
// add drawing to current page // add drawing to current page
m_frames[ m_frameIndex ]->drawings << m_drawingEngine->endSmoothPath(); m_frames[ m_frameIndex ]->drawings << m_drawingEngine->endSmoothPath();
// manually disable and re-enable the pencil mode, so we can do // remove the actual drawer and create a new one just after
// cleaning of the actual drawer and create a new one just after
// that - that gives continuous drawing // that - that gives continuous drawing
slotChangeDrawingToolEngine( QDomElement() ); delete m_drawingEngine;
slotChangeDrawingToolEngine( m_currentDrawingToolElement ); m_drawingRect = QRect();
m_drawingEngine = new SmoothPathEngine( m_currentDrawingToolElement );
// schedule repaint // schedule repaint
update(); update();
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment