16#include <QApplication>
53using namespace std::placeholders;
195 Q_UNUSED(paintOpIgnoredEvent);
215 QString message = i18n(
"The brush tool cannot paint on this layer. Please select a paint layer or mask.");
220 QString message = i18n(
"The MyPaint Brush Engine is not available for this colorspace");
260 static_cast<KisCanvas2*
>(
canvas())->paintingAssistantsDecoration()->endStroke();
298 return !paintOpIgnoredEvent;
358 QPointF offset = actualWidgetPosition - lastWidgetPosition;
362 QRect screenRect = QGuiApplication::primaryScreen()->availableVirtualGeometry();
369 const qreal effectiveMaxDragSize = 0.5 * screenRect.width();
370 const qreal effectiveMaxBrushSize = qMin(maxBrushSize, effectiveMaxDragSize / scaleX);
372 const qreal scaleCoeff = effectiveMaxBrushSize / effectiveMaxDragSize;
373 const qreal sizeDiff = scaleCoeff * offset.x() ;
375 if (qAbs(sizeDiff) > 0.01) {
381 newSize = qMax(qRound(newSize), 1);
384 newSize = qBound(0.01, newSize, maxBrushSize);
386 settings->setPaintOpSize(newSize);
442 settings->setPaintOpSize(newSize);
465 qreal perspective = 1.0;
468 if (grid && grid->isActive() && grid->contains(documentPoint)) {
469 perspective = grid->distance(documentPoint);
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
KisCoordinatesConverter * coordinatesConverter
KisViewManager * viewManager() const
KisPaintingAssistantsDecorationSP paintingAssistantsDecoration() const
static KisConfigNotifier * instance()
CursorStyle newCursorStyle(bool defaultValue=false) const
CursorStyle eraserCursorStyle(bool defaultValue=false) const
bool separateEraserCursor(bool defaultValue=false) const
void imageScale(qreal *scaleX, qreal *scaleY) const
static QCursor pixelBlackCursor()
static QCursor blankCursor()
static QCursor crossCursor()
static QCursor triangleRightHandedCursor()
static QCursor arrowCursor()
static QCursor triangleLeftHandedCursor()
static QCursor roundCursor()
static QCursor pixelWhiteCursor()
static QCursor eraserCursor()
int maxBrushSize(bool defaultValue=false) const
void setOnlyOneAssistantSnap(bool assistant)
sets whether we snap to only one assistant
void setAdjustedBrushPosition(const QPointF position)
void setEraserSnap(bool assistant)
sets whether eraser brushes snap
QPointF adjustPosition(const QPointF &point, const QPointF &strokeBegin)
void enableControls()
disable and enable toolbar controls. used for disabling them during painting.
void showFloatingMessage(const QString &message, const QIcon &icon, int timeout=4500, KisFloatingMessage::Priority priority=KisFloatingMessage::Medium, int alignment=Qt::AlignCenter|Qt::TextWordWrap)
shows a floating message in the top right corner of the canvas
QPointer< KoCanvasResourceProvider > resourceManager
qreal rotation() const
return the rotation (or a default value)
qreal tangentialPressure() const
Qt::KeyboardModifiers modifiers() const
QPointF point
The point in document coordinates.
#define KIS_SAFE_ASSERT_RECOVER_RETURN(cond)
@ CURSOR_STYLE_SMALL_ROUND
@ CURSOR_STYLE_TRIANGLE_RIGHTHANDED
@ CURSOR_STYLE_WHITE_PIXEL
@ CURSOR_STYLE_BLACK_PIXEL
@ CURSOR_STYLE_TRIANGLE_LEFTHANDED
#define koIcon(name)
Use these macros for icons without any issues.