18 #include "stroketool.h"
21 #include "scribblearea.h"
22 #include "strokemanager.h"
23 #include "viewmanager.h"
28 void detectWhichOSX();
29 void disableCoalescing();
30 void enableCoalescing();
34 void detectWhichOSX() {}
35 void disableCoalescing() {}
36 void enableCoalescing() {}
45 void StrokeTool::startStroke(PointerEvent::InputType inputType)
53 mLastPixel = getCurrentPixel();
55 mStrokePoints.
clear();
58 QPointF startStrokes = strokeManager()->interpolateStart(mLastPixel);
59 mStrokePoints << mEditor->view()->mapScreenToCanvas(startStrokes);
61 mStrokePressures.
clear();
62 mStrokePressures << strokeManager()->getPressure();
64 mCurrentInputType = inputType;
69 bool StrokeTool::keyPressEvent(
QKeyEvent *event)
71 switch (event->
key()) {
73 mScribbleArea->setTemporaryTool(EYEDROPPER);
76 mScribbleArea->setTemporaryTool(HAND);
82 bool StrokeTool::keyReleaseEvent(
QKeyEvent *event)
93 void StrokeTool::endStroke()
95 strokeManager()->interpolateEnd();
96 mStrokePressures << strokeManager()->getPressure();
97 mStrokePoints.
clear();
98 mStrokePressures.
clear();
103 void StrokeTool::drawStroke()
105 QPointF pixel = getCurrentPixel();
106 if (pixel != mLastPixel || !mFirstDraw)
109 QPointF startStrokes = strokeManager()->interpolateStart(getLastPixel());
110 mStrokePoints << mEditor->view()->mapScreenToCanvas(startStrokes);
111 mStrokePressures << strokeManager()->getPressure();
void handleDrawingOnEmptyFrame()
Call this when starting to use a paint tool.