Commit eacd03c0 authored by Dmitry Kazakov's avatar Dmitry Kazakov

FEATURE: Force brush outline to be always painted at 100% size

Use special checkbox in General tab to configure that
parent 336c78d5
......@@ -385,13 +385,13 @@ bool KisPaintOpSettings::needsAsynchronousUpdates() const
return false;
}
QPainterPath KisPaintOpSettings::brushOutline(const KisPaintInformation &info, OutlineMode mode)
QPainterPath KisPaintOpSettings::brushOutline(const KisPaintInformation &info, const OutlineMode &mode)
{
QPainterPath path;
if (mode == CursorIsOutline || mode == CursorIsCircleOutline || mode == CursorTiltOutline) {
if (mode.isVisible) {
path = ellipseOutline(10, 10, 1.0, 0);
if (mode == CursorTiltOutline) {
if (mode.showTiltDecoration) {
path.addPath(makeTiltIndicator(info, QPointF(0.0, 0.0), 0.0, 2.0));
}
......
......@@ -164,13 +164,13 @@ public:
virtual bool needsAsynchronousUpdates() const;
/**
* This enum defines the current mode for painting an outline.
* This structure defines the current mode for painting an outline.
*/
enum OutlineMode {
CursorIsOutline = 1, ///< When this mode is set, an outline is painted around the cursor
CursorIsCircleOutline,
CursorNoOutline,
CursorTiltOutline
struct OutlineMode {
bool isVisible = false;
bool forceCircle = false;
bool showTiltDecoration = false;
bool forceFullSize = false;
};
/**
......@@ -178,7 +178,7 @@ public:
* Outline mode has to be passed to the paintop which builds the outline as some paintops have to paint outline
* always like clone paintop indicating the duplicate position
*/
virtual QPainterPath brushOutline(const KisPaintInformation &info, OutlineMode mode);
virtual QPainterPath brushOutline(const KisPaintInformation &info, const OutlineMode &mode);
/**
* Helpers for drawing the brush outline
......
......@@ -117,6 +117,7 @@ GeneralTab::GeneralTab(QWidget *_parent, const char *_name)
m_cmbOutlineShape->setCurrentIndex(cfg.newOutlineStyle());
m_showOutlinePainting->setChecked(cfg.showOutlineWhilePainting());
m_forceFullSizedBrushOutline->setChecked(cfg.forceAlwaysFullSizedOutline());
KoColor cursorColor(KoColorSpaceRegistry::instance()->rgb8());
cursorColor.fromQColor(cfg.getCursorMainColor());
......@@ -217,6 +218,7 @@ void GeneralTab::setDefault()
m_undoStackSize->setValue(cfg.undoStackLimit(true));
m_backupFileCheckBox->setChecked(cfg.backupFile(true));
m_showOutlinePainting->setChecked(cfg.showOutlineWhilePainting(true));
m_forceFullSizedBrushOutline->setChecked(cfg.forceAlwaysFullSizedOutline(true));
m_hideSplashScreen->setChecked(cfg.hideSplashScreen(true));
m_chkNativeFileDialog->setChecked(false);
......@@ -1279,6 +1281,7 @@ bool KisDlgPreferences::editPreferences()
cfg.setNewOutlineStyle(dialog->m_general->outlineStyle());
cfg.setShowRootLayer(dialog->m_general->showRootLayer());
cfg.setShowOutlineWhilePainting(dialog->m_general->showOutlineWhilePainting());
cfg.setForceAlwaysFullSizedOutline(dialog->m_general->m_forceFullSizedBrushOutline->isChecked());
cfg.setHideSplashScreen(dialog->m_general->hideSplashScreen());
cfg.setSessionOnStartup(dialog->m_general->sessionOnStartup());
cfg.setSaveSessionOnQuit(dialog->m_general->saveSessionOnQuit());
......
......@@ -113,14 +113,14 @@
</property>
</widget>
</item>
<item row="3" column="0">
<item row="4" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Cursor Color:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<item row="4" column="1">
<widget class="KisColorButton" name="cursorColorBtutton">
<property name="maximumSize">
<size>
......@@ -133,6 +133,13 @@
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QCheckBox" name="m_forceFullSizedBrushOutline">
<property name="text">
<string>Always show brush outline at 100% scale</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="2" column="0">
......
......@@ -960,6 +960,16 @@ void KisConfig::setShowOutlineWhilePainting(bool showOutlineWhilePainting) const
m_cfg.writeEntry("ShowOutlineWhilePainting", showOutlineWhilePainting);
}
bool KisConfig::forceAlwaysFullSizedOutline(bool defaultValue) const
{
return (defaultValue ? false : m_cfg.readEntry("forceAlwaysFullSizedOutline", false));
}
void KisConfig::setForceAlwaysFullSizedOutline(bool value) const
{
m_cfg.writeEntry("forceAlwaysFullSizedOutline", value);
}
bool KisConfig::hideSplashScreen(bool defaultValue) const
{
KConfigGroup cfg( KSharedConfig::openConfig(), "SplashScreen");
......
......@@ -248,6 +248,9 @@ public:
bool showOutlineWhilePainting(bool defaultValue = false) const;
void setShowOutlineWhilePainting(bool showOutlineWhilePainting) const;
bool forceAlwaysFullSizedOutline(bool defaultValue = false) const;
void setForceAlwaysFullSizedOutline(bool value) const;
bool hideSplashScreen(bool defaultValue = false) const;
void setHideSplashScreen(bool hideSplashScreen) const;
......
......@@ -721,7 +721,6 @@ void KisToolPaint::requestUpdateOutline(const QPointF &outlineDocPoint, const Ko
KisConfig cfg;
KisPaintOpSettings::OutlineMode outlineMode;
outlineMode = KisPaintOpSettings::CursorNoOutline;
if (isOutlineEnabled() &&
(mode() == KisTool::GESTURE_MODE ||
......@@ -731,15 +730,20 @@ void KisToolPaint::requestUpdateOutline(const QPointF &outlineDocPoint, const Ko
((mode() == HOVER_MODE) ||
(mode() == PAINT_MODE && cfg.showOutlineWhilePainting()))))) { // lisp forever!
if(cfg.newOutlineStyle() == OUTLINE_CIRCLE) {
outlineMode = KisPaintOpSettings::CursorIsCircleOutline;
outlineMode.isVisible = true;
if (cfg.newOutlineStyle() == OUTLINE_CIRCLE) {
outlineMode.forceCircle = true;
} else if(cfg.newOutlineStyle() == OUTLINE_TILT) {
outlineMode = KisPaintOpSettings::CursorTiltOutline;
outlineMode.forceCircle = true;
outlineMode.showTiltDecoration = true;
} else {
outlineMode = KisPaintOpSettings::CursorIsOutline;
// noop
}
}
outlineMode.forceFullSize = cfg.forceAlwaysFullSizedOutline();
m_outlineDocPoint = outlineDocPoint;
m_currentOutline = getOutlinePath(m_outlineDocPoint, event, outlineMode);
......
......@@ -132,12 +132,19 @@ KisPaintOpSettingsSP KisDuplicateOpSettings::clone() const
return setting;
}
QPainterPath KisDuplicateOpSettings::brushOutline(const KisPaintInformation &info, OutlineMode mode)
QPainterPath KisDuplicateOpSettings::brushOutline(const KisPaintInformation &info, const OutlineMode &mode)
{
QPainterPath path;
OutlineMode forcedMode = mode;
if (!forcedMode.isVisible) {
forcedMode.isVisible = true;
forcedMode.forceCircle = true;
}
// clone tool should always show an outline
path = KisBrushBasedPaintOpSettings::brushOutlineImpl(info, mode, 1.0, true);
path = KisBrushBasedPaintOpSettings::brushOutlineImpl(info, forcedMode, 1.0);
QPainterPath copy(path);
QRectF rect2 = copy.boundingRect();
......
......@@ -50,7 +50,7 @@ public:
KisPaintOpSettingsSP clone() const override;
using KisBrushBasedPaintOpSettings::brushOutline;
QPainterPath brushOutline(const KisPaintInformation &info, OutlineMode mode) override;
QPainterPath brushOutline(const KisPaintInformation &info, const OutlineMode &mode) override;
KisNodeWSP sourceNode() const;
......
......@@ -71,19 +71,19 @@ bool KisDeformPaintOpSettings::isAirbrushing() const
}
}
QPainterPath KisDeformPaintOpSettings::brushOutline(const KisPaintInformation &info, OutlineMode mode)
QPainterPath KisDeformPaintOpSettings::brushOutline(const KisPaintInformation &info, const OutlineMode &mode)
{
QPainterPath path;
if (mode == CursorIsOutline || mode == CursorIsCircleOutline || mode == CursorTiltOutline) {
if (mode.isVisible) {
qreal width = getInt(BRUSH_DIAMETER);
qreal height = getInt(BRUSH_DIAMETER) * getDouble(BRUSH_ASPECT);
path = ellipseOutline(width, height, getDouble(BRUSH_SCALE), getDouble(BRUSH_ROTATION));
path = outlineFetcher()->fetchOutline(info, this, path);
path = outlineFetcher()->fetchOutline(info, this, path, mode);
if (mode == CursorTiltOutline) {
if (mode.showTiltDecoration) {
QPainterPath tiltLine = makeTiltIndicator(info, QPointF(0.0, 0.0), width * 0.5, 3.0);
path.addPath(outlineFetcher()->fetchOutline(info, this, tiltLine, 1.0, 0.0, true, 0, 0));
path.addPath(outlineFetcher()->fetchOutline(info, this, tiltLine, mode, 1.0, 0.0, true, 0, 0));
}
}
return path;
......
......@@ -34,7 +34,7 @@ public:
void setPaintOpSize(qreal value) override;
qreal paintOpSize() const override;
QPainterPath brushOutline(const KisPaintInformation &info, OutlineMode mode) override;
QPainterPath brushOutline(const KisPaintInformation &info, const OutlineMode &mode) override;
bool paintIncremental() override;
bool isAirbrushing() const override;
......
......@@ -47,10 +47,10 @@ bool KisExperimentPaintOpSettings::paintIncremental()
return false;
}
QPainterPath KisExperimentPaintOpSettings::brushOutline(const KisPaintInformation &info, KisPaintOpSettings::OutlineMode mode)
QPainterPath KisExperimentPaintOpSettings::brushOutline(const KisPaintInformation &info, const OutlineMode &mode)
{
QPainterPath path;
if (mode == CursorIsOutline || mode == CursorIsCircleOutline || mode == CursorTiltOutline) {
if (mode.isVisible) {
QRectF ellipse(0, 0, 3, 3);
ellipse.translate(-ellipse.center());
......@@ -59,7 +59,7 @@ QPainterPath KisExperimentPaintOpSettings::brushOutline(const KisPaintInformatio
ellipse.translate(-ellipse.center());
path.addEllipse(ellipse);
if (mode == CursorTiltOutline) {
if (mode.showTiltDecoration) {
path.addPath(makeTiltIndicator(info, QPointF(0.0, 0.0), 0.0, 3.0));
}
......
......@@ -30,7 +30,7 @@ public:
bool lodSizeThresholdSupported() const override;
bool paintIncremental() override;
QPainterPath brushOutline(const KisPaintInformation &info, OutlineMode mode) override;
QPainterPath brushOutline(const KisPaintInformation &info, const OutlineMode &mode) override;
QList<KisUniformPaintOpPropertySP> uniformProperties(KisPaintOpSettingsSP settings) override;
......
......@@ -62,21 +62,21 @@ bool KisGridPaintOpSettings::paintIncremental()
return (enumPaintActionType)getInt("PaintOpAction", WASH) == BUILDUP;
}
QPainterPath KisGridPaintOpSettings::brushOutline(const KisPaintInformation &info, OutlineMode mode)
QPainterPath KisGridPaintOpSettings::brushOutline(const KisPaintInformation &info, const OutlineMode &mode)
{
QPainterPath path;
if (mode == CursorIsOutline || mode == CursorIsCircleOutline || mode == CursorTiltOutline) {
if (mode.isVisible) {
qreal sizex = getInt(GRID_WIDTH) * getDouble(GRID_SCALE);
qreal sizey = getInt(GRID_HEIGHT) * getDouble(GRID_SCALE);
QRectF rc(0, 0, sizex, sizey);
rc.translate(-rc.center());
path.addRect(rc);
path = outlineFetcher()->fetchOutline(info, this, path);
path = outlineFetcher()->fetchOutline(info, this, path, mode);
if (mode == CursorTiltOutline) {
if (mode.showTiltDecoration) {
QPainterPath tiltLine = makeTiltIndicator(info, QPointF(0.0, 0.0), sizex * 0.5, 3.0);
path.addPath(outlineFetcher()->fetchOutline(info, this, tiltLine, 1.0, 0.0, true, 0, 0));
path.addPath(outlineFetcher()->fetchOutline(info, this, tiltLine, mode, 1.0, 0.0, true, 0, 0));
}
}
return path;
......
......@@ -38,7 +38,7 @@ public:
void setPaintOpSize(qreal value) override;
qreal paintOpSize() const override;
QPainterPath brushOutline(const KisPaintInformation &info, OutlineMode mode) override;
QPainterPath brushOutline(const KisPaintInformation &info, const OutlineMode &mode) override;
bool paintIncremental() override;
QList<KisUniformPaintOpPropertySP> uniformProperties(KisPaintOpSettingsSP settings) override;
......
......@@ -30,7 +30,7 @@ KisHairyPaintOpSettings::KisHairyPaintOpSettings()
{
}
QPainterPath KisHairyPaintOpSettings::brushOutline(const KisPaintInformation &info, OutlineMode mode)
QPainterPath KisHairyPaintOpSettings::brushOutline(const KisPaintInformation &info, const OutlineMode &mode)
{
return brushOutlineImpl(info, mode, getDouble(HAIRY_BRISTLE_SCALE));
}
......@@ -34,7 +34,7 @@ public:
KisHairyPaintOpSettings();
using KisBrushBasedPaintOpSettings::brushOutline;
QPainterPath brushOutline(const KisPaintInformation &info, OutlineMode mode) override;
QPainterPath brushOutline(const KisPaintInformation &info, const OutlineMode &mode) override;
};
......
......@@ -100,42 +100,40 @@ KisBrushSP KisBrushBasedPaintOpSettings::brush() const
}
QPainterPath KisBrushBasedPaintOpSettings::brushOutlineImpl(const KisPaintInformation &info,
OutlineMode mode,
qreal additionalScale,
bool forceOutline)
const OutlineMode &mode,
qreal additionalScale)
{
QPainterPath path;
if (forceOutline || mode == CursorIsOutline || mode == CursorIsCircleOutline || mode == CursorTiltOutline) {
if (mode.isVisible) {
KisBrushSP brush = this->brush();
if (!brush) return path;
qreal finalScale = brush->scale() * additionalScale;
QPainterPath realOutline = brush->outline();
if (mode == CursorIsCircleOutline || mode == CursorTiltOutline ||
(forceOutline && mode == CursorNoOutline)) {
if (mode.forceCircle) {
QPainterPath ellipse;
ellipse.addEllipse(realOutline.boundingRect());
realOutline = ellipse;
}
path = outlineFetcher()->fetchOutline(info, this, realOutline, finalScale, brush->angle());
path = outlineFetcher()->fetchOutline(info, this, realOutline, mode, finalScale, brush->angle());
if (mode == CursorTiltOutline) {
if (mode.showTiltDecoration) {
const QPainterPath tiltLine = makeTiltIndicator(info,
realOutline.boundingRect().center(),
realOutline.boundingRect().width() * 0.5,
3.0);
path.addPath(outlineFetcher()->fetchOutline(info, this, tiltLine, finalScale, 0.0, true, realOutline.boundingRect().center().x(), realOutline.boundingRect().center().y()));
path.addPath(outlineFetcher()->fetchOutline(info, this, tiltLine, mode, finalScale, 0.0, true, realOutline.boundingRect().center().x(), realOutline.boundingRect().center().y()));
}
}
return path;
}
QPainterPath KisBrushBasedPaintOpSettings::brushOutline(const KisPaintInformation &info, OutlineMode mode)
QPainterPath KisBrushBasedPaintOpSettings::brushOutline(const KisPaintInformation &info, const OutlineMode &mode)
{
return brushOutlineImpl(info, mode, 1.0);
}
......
......@@ -37,7 +37,7 @@ public:
bool paintIncremental() override;
using KisPaintOpSettings::brushOutline;
QPainterPath brushOutline(const KisPaintInformation &info, OutlineMode mode) override;
QPainterPath brushOutline(const KisPaintInformation &info, const OutlineMode &mode) override;
///Reimplemented
bool isValid() const override;
......@@ -68,7 +68,7 @@ public:
protected:
void onPropertyChanged() override;
QPainterPath brushOutlineImpl(const KisPaintInformation &info, OutlineMode mode, qreal additionalScale, bool forceOutline = false);
QPainterPath brushOutlineImpl(const KisPaintInformation &info, const OutlineMode &mode, qreal additionalScale);
mutable KisBrushSP m_savedBrush;
QList<KisUniformPaintOpPropertyWSP> m_uniformProperties;
......
......@@ -74,6 +74,7 @@ void KisCurrentOutlineFetcher::setDirty()
QPainterPath KisCurrentOutlineFetcher::fetchOutline(const KisPaintInformation &info,
const KisPaintOpSettingsSP settings,
const QPainterPath &originalOutline,
const KisPaintOpSettings::OutlineMode &mode,
qreal additionalScale,
qreal additionalRotation,
bool tilt, qreal tiltcenterx, qreal tiltcentery) const
......@@ -99,7 +100,6 @@ QPainterPath KisCurrentOutlineFetcher::fetchOutline(const KisPaintInformation &i
qreal scale = additionalScale;
qreal rotation = additionalRotation;
MirrorProperties mirrorProperties;
bool needsUpdate = false;
// Randomized rotation at full speed looks noisy, so slow it down
......@@ -108,19 +108,19 @@ QPainterPath KisCurrentOutlineFetcher::fetchOutline(const KisPaintInformation &i
d->lastUpdateTime.restart();
}
if (d->sizeOption && tilt == false) {
if (d->sizeOption && !tilt && !mode.forceFullSize) {
if (!d->sizeOption->isRandom() || needsUpdate) {
d->lastSizeApplied = d->sizeOption->apply(info);
}
scale *= d->lastSizeApplied;
}
if (d->rotationOption && tilt == false) {
if (d->rotationOption && !tilt) {
if (!d->rotationOption->isRandom() || needsUpdate) {
d->lastRotationApplied = d->rotationOption->apply(info);
}
rotation += d->lastRotationApplied;
} else if (d->rotationOption && tilt == true) {
} else if (d->rotationOption && tilt) {
rotation += settings->getDouble("runtimeCanvasRotation", 0.0) * M_PI / 180.0;
}
......@@ -150,8 +150,9 @@ QPainterPath KisCurrentOutlineFetcher::fetchOutline(const KisPaintInformation &i
rot.rotateRadians(-rotation);
QPointF hotSpot = originalOutline.boundingRect().center();
if (tilt==true) {
hotSpot.setX(tiltcenterx);hotSpot.setY(tiltcentery);
if (tilt) {
hotSpot.setX(tiltcenterx);
hotSpot.setY(tiltcentery);
}
QTransform T1 = QTransform::fromTranslate(-hotSpot.x(), -hotSpot.y());
QTransform T2 = QTransform::fromTranslate(info.pos().x(), info.pos().y());
......
......@@ -53,6 +53,7 @@ public:
QPainterPath fetchOutline(const KisPaintInformation &info,
const KisPaintOpSettingsSP settings,
const QPainterPath &originalOutline,
const KisPaintOpSettings::OutlineMode &mode,
qreal additionalScale = 1.0,
qreal additionalRotation = 0.0,
bool tilt = false, qreal tiltcenterx = 1.0, qreal tiltcentery = 1.0) const;
......
......@@ -55,11 +55,11 @@ qreal KisRoundMarkerOpSettings::paintOpSize() const
return op.diameter;
}
QPainterPath KisRoundMarkerOpSettings::brushOutline(const KisPaintInformation &info, OutlineMode mode)
QPainterPath KisRoundMarkerOpSettings::brushOutline(const KisPaintInformation &info, const OutlineMode &mode)
{
QPainterPath path;
if (mode == CursorIsOutline || mode == CursorIsCircleOutline || mode == CursorTiltOutline) {
if (mode.isVisible) {
qreal finalScale = 1.0;
RoundMarkerOption op;
......@@ -69,14 +69,14 @@ QPainterPath KisRoundMarkerOpSettings::brushOutline(const KisPaintInformation &i
QPainterPath realOutline;
realOutline.addEllipse(QPointF(), radius, radius);
path = outlineFetcher()->fetchOutline(info, this, realOutline, finalScale);
path = outlineFetcher()->fetchOutline(info, this, realOutline, mode, finalScale);
if (mode == CursorTiltOutline) {
if (mode.showTiltDecoration) {
QPainterPath tiltLine = makeTiltIndicator(info,
realOutline.boundingRect().center(),
realOutline.boundingRect().width() * 0.5,
3.0);
path.addPath(outlineFetcher()->fetchOutline(info, this, tiltLine, finalScale, 0.0, true, realOutline.boundingRect().center().x(), realOutline.boundingRect().center().y()));
path.addPath(outlineFetcher()->fetchOutline(info, this, tiltLine, mode, finalScale, 0.0, true, realOutline.boundingRect().center().x(), realOutline.boundingRect().center().y()));
}
}
......
......@@ -45,7 +45,7 @@ public:
return 1000.0;
}
QPainterPath brushOutline(const KisPaintInformation &info, OutlineMode mode) override;
QPainterPath brushOutline(const KisPaintInformation &info, const OutlineMode &mode) override;
QList<KisUniformPaintOpPropertySP> uniformProperties(KisPaintOpSettingsSP settings) override;
......
......@@ -21,7 +21,6 @@
#include <kis_sketchop_option.h>
#include <kis_paint_action_type_option.h>
#include <kis_airbrush_option_widget.h>
#include "kis_current_outline_fetcher.h"
......@@ -34,7 +33,7 @@ bool KisSketchPaintOpSettings::paintIncremental()
return (enumPaintActionType)getInt("PaintOpAction", WASH) == BUILDUP;
}
QPainterPath KisSketchPaintOpSettings::brushOutline(const KisPaintInformation &info, OutlineMode mode)
QPainterPath KisSketchPaintOpSettings::brushOutline(const KisPaintInformation &info, const OutlineMode &mode)
{
bool isSimpleMode = getBool(SKETCH_USE_SIMPLE_MODE);
......@@ -42,21 +41,20 @@ QPainterPath KisSketchPaintOpSettings::brushOutline(const KisPaintInformation &i
return KisBrushBasedPaintOpSettings::brushOutline(info, mode);
}
KisBrushBasedPaintopOptionWidget *widget = dynamic_cast<KisBrushBasedPaintopOptionWidget*>(optionsWidget());
QPainterPath path;
if (widget && (mode == CursorIsOutline || mode == CursorIsCircleOutline || mode == CursorTiltOutline)) {
KisBrushSP brush = widget->brush();
KisBrushSP brush = this->brush();
if (brush && mode.isVisible) {
// just circle supported
qreal diameter = qMax(brush->width(), brush->height());
path = ellipseOutline(diameter, diameter, 1.0, 0.0/*brush->scale(), brush->angle()*/);
path = ellipseOutline(diameter, diameter, 1.0, 0.0);
path = outlineFetcher()->fetchOutline(info, this, path);
if (mode == CursorTiltOutline) {
path = outlineFetcher()->fetchOutline(info, this, path, mode);
if (mode.showTiltDecoration) {
QPainterPath tiltLine =
makeTiltIndicator(info, path.boundingRect().center(), diameter * 0.5, 3.0);
tiltLine.translate(info.pos());
path.addPath(outlineFetcher()->fetchOutline(info, this, tiltLine, 1.0, 0.0, true, path.boundingRect().center().x(), path.boundingRect().center().y()));
path.addPath(outlineFetcher()->fetchOutline(info, this, tiltLine, mode, 1.0, 0.0, true, path.boundingRect().center().x(), path.boundingRect().center().y()));
}
}
return path;
......
......@@ -34,7 +34,7 @@ public:
KisSketchPaintOpSettings();
~KisSketchPaintOpSettings() override {}
QPainterPath brushOutline(const KisPaintInformation &info, OutlineMode mode) override;
QPainterPath brushOutline(const KisPaintInformation &info, const OutlineMode &mode) override;
bool paintIncremental() override;
};
......
......@@ -66,20 +66,20 @@ bool KisSprayPaintOpSettings::paintIncremental()
}
QPainterPath KisSprayPaintOpSettings::brushOutline(const KisPaintInformation &info, OutlineMode mode)
QPainterPath KisSprayPaintOpSettings::brushOutline(const KisPaintInformation &info, const OutlineMode &mode)
{
QPainterPath path;
if (mode == CursorIsOutline || mode == CursorIsCircleOutline || mode == CursorTiltOutline) {
if (mode.isVisible) {
qreal width = getInt(SPRAY_DIAMETER);
qreal height = getInt(SPRAY_DIAMETER) * getDouble(SPRAY_ASPECT);
path = ellipseOutline(width, height, getDouble(SPRAY_SCALE), getDouble(SPRAY_ROTATION));
path = outlineFetcher()->fetchOutline(info, this, path);
path = outlineFetcher()->fetchOutline(info, this, path, mode);
if (mode == CursorTiltOutline) {
if (mode.forceFullSize) {
QPainterPath tiltLine =
makeTiltIndicator(info, QPointF(0.0, 0.0), width * 0.5, 3.0);
path.addPath(outlineFetcher()->fetchOutline(info, this, tiltLine, 1.0, 0.0, true, 0, 0));
path.addPath(outlineFetcher()->fetchOutline(info, this, tiltLine, mode, 1.0, 0.0, true, 0, 0));
}
}
return path;
......
......@@ -37,7 +37,7 @@ public:
void setPaintOpSize(qreal value) override;
qreal paintOpSize() const override;
QPainterPath brushOutline(const KisPaintInformation &info, OutlineMode mode) override;
QPainterPath brushOutline(const KisPaintInformation &info, const OutlineMode &mode) override;
QString modelName() const override {
return "airbrush";
......
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