virtualvoid viewChanged( const UnoViewSharedPtr& /*rView*/ ) override
{ // TODO(F2): for persistent drawings, need to store // polygon and repaint here.
}
virtualvoid viewsChanged() override
{ // TODO(F2): for persistent drawings, need to store // polygon and repaint here.
}
void repaintWithoutPolygons()
{ // must get access to the instance to erase all polygon for( constauto& rxView : maViews )
{ // fully clear view content to background color //rxView->getCanvas()->clear();
//get via SlideImpl instance the bitmap of the slide unmodified to redraw it
SlideBitmapSharedPtr pBitmap( mrSlide.getCurrentSlideBitmap( rxView ) );
::cppcanvas::CanvasSharedPtr pCanvas( rxView->getCanvas() );
// setup a canvas with device coordinate space, the slide // bitmap already has the correct dimension.
::cppcanvas::CanvasSharedPtr pDevicePixelCanvas( pCanvas->clone() );
// render at given output position
pBitmap->move( aOutPosPixel );
// clear clip (might have been changed, e.g. from comb // transition)
pBitmap->clip( ::basegfx::B2DPolyPolygon() );
pBitmap->draw( pDevicePixelCanvas );
mrScreenUpdater.notifyUpdate(rxView,true);
}
}
bool eraseAllInkChanged( bool bEraseAllInk ) override
{
mbIsEraseAllModeActivated = bEraseAllInk; // if the erase all mode is activated it will remove all ink from slide, // therefore destroy all the polygons stored if(mbIsEraseAllModeActivated)
{ // The Erase Mode should be deactivated
mbIsEraseModeActivated = false;
repaintWithoutPolygons();
maPolygons.clear();
}
mbIsEraseAllModeActivated=false; returntrue;
}
if (e.Buttons == awt::MouseButton::RIGHT)
{
mbIsLastPointValid = false; returnfalse;
}
if (e.Buttons != awt::MouseButton::LEFT) returnfalse;
// check, whether up- and down press are on exactly // the same pixel. If that's the case, ignore the // click, and pass on the event to low-prio // handlers. This effectively permits effect // advancements via clicks also when user paint is // enabled. if( mbIsLastMouseDownPosValid &&
::basegfx::B2DPoint( e.X,
e.Y ) == maLastMouseDownPos )
{
mbIsLastMouseDownPosValid = false; returnfalse;
}
// invalidate, next downpress will have to start a new // polygon.
mbIsLastPointValid = false;
// eat mouse click (though we don't process it // _directly_, it enables the drag mode returntrue;
}
if (e.Buttons == awt::MouseButton::RIGHT)
{
mbIsLastPointValid = false; returnfalse;
}
if(mbIsEraseModeActivated)
{ //define the last point as an object //we suppose that there's no way this point could be valid
::basegfx::B2DPolygon aPoly;
//The point is to redraw the LastPoint the way it was originally on the bitmap, //of the slide for (constauto& rxView : maViews)
{
//get via SlideImpl instance the bitmap of the slide unmodified to redraw it
SlideBitmapSharedPtr pBitmap( mrSlide.getCurrentSlideBitmap( rxView ) );
::cppcanvas::CanvasSharedPtr pCanvas( rxView->getCanvas() );
// setup a canvas with device coordinate space, the slide // bitmap already has the correct dimension.
::cppcanvas::CanvasSharedPtr pDevicePixelCanvas( pCanvas->clone() );
// render at given output position
pBitmap->move( aOutPosPixel );
::basegfx::B2DPolyPolygon aPolyPoly(aPoly);
aViewTransform.translate(-aOutPosPixel.getX(), -aOutPosPixel.getY());
aPolyPoly.transform(aViewTransform); // set clip so that we just redraw a part of the canvas
pBitmap->clip(aPolyPoly);
pBitmap->draw( pDevicePixelCanvas );
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.