18#include "stroketool.h"
21#include "scribblearea.h"
22#include "strokemanager.h"
23#include "viewmanager.h"
25#include "toolmanager.h"
29 void detectWhichOSX();
30 void disableCoalescing();
31 void enableCoalescing();
35 void detectWhichOSX() {}
36 void disableCoalescing() {}
37 void enableCoalescing() {}
46void StrokeTool::startStroke(PointerEvent::InputType inputType)
54 mLastPixel = getCurrentPixel();
56 mStrokePoints.
clear();
59 QPointF startStrokes = strokeManager()->interpolateStart(mLastPixel);
60 mStrokePoints << mEditor->view()->mapScreenToCanvas(startStrokes);
62 mStrokePressures.
clear();
63 mStrokePressures << strokeManager()->getPressure();
65 mCurrentInputType = inputType;
70bool StrokeTool::keyPressEvent(
QKeyEvent *event)
72 switch (
event->key()) {
74 if (mEditor->tools()->setTemporaryTool(EYEDROPPER, {},
Qt::AltModifier))
86 return BaseTool::keyPressEvent(
event);
94void StrokeTool::endStroke()
96 strokeManager()->interpolateEnd();
97 mStrokePressures << strokeManager()->getPressure();
98 mStrokePoints.
clear();
99 mStrokePressures.
clear();
103 mEditor->setModified(mEditor->currentLayerIndex(), mEditor->currentFrame());
106void StrokeTool::drawStroke()
108 QPointF pixel = getCurrentPixel();
109 if (pixel != mLastPixel || !mFirstDraw)
112 QPointF startStrokes = strokeManager()->interpolateStart(getLastPixel());
113 mStrokePoints << mEditor->view()->mapScreenToCanvas(startStrokes);
114 mStrokePressures << strokeManager()->getPressure();
void handleDrawingOnEmptyFrame()
Call this when starting to use a paint tool.
virtual bool event(QEvent *e)