Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_sketch_paintop_settings.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2010 Lukáš Tvrdý <lukast.dev@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
8
12
17
24
26{
27 bool isSimpleMode = getBool("Sketch/simpleMode");
28
29 if (!isSimpleMode) {
30 return KisBrushBasedPaintOpSettings::brushOutline(info, mode, alignForZoom);
31 }
32
34
35 KisBrushSP brush = this->brush();
36
37 if (brush && mode.isVisible) {
38 // just circle supported
39 qreal diameter = qMax(brush->width(), brush->height());
40 path = ellipseOutline(diameter, diameter, 1.0, 0.0);
41
42 path = outlineFetcher()->fetchOutline(info, this, path, mode, alignForZoom);
43 if (mode.showTiltDecoration) {
44 QPainterPath tiltLine =
45 makeTiltIndicator(info, path.boundingRect().center(), diameter * 0.5, 3.0);
46 path.addPath(outlineFetcher()->fetchOutline(info, this, tiltLine, mode, alignForZoom, 1.0, 0.0, true, path.boundingRect().center().x(), path.boundingRect().center().y()));
47 }
48 }
49 return path;
50}
51
53{
54 return false;
55}
KisOptimizedBrushOutline brushOutline(const KisPaintInformation &info, const OutlineMode &mode, qreal alignForZoom) override
KisOptimizedBrushOutline fetchOutline(const KisPaintInformation &info, const KisPaintOpSettingsSP settings, const KisOptimizedBrushOutline &originalOutline, const KisPaintOpSettings::OutlineMode &mode, qreal alignForZoom, qreal additionalScale=1.0, qreal additionalRotation=0.0, bool tilt=false, qreal tiltcenterx=1.0, qreal tiltcentery=1.0) const
const KisCurrentOutlineFetcher * outlineFetcher() const
KisOptimizedBrushOutline brushOutline(const KisPaintInformation &info, const OutlineMode &mode, qreal alignForZoom) override
bool paintIncremental() override
Reimplemented.
KisSketchPaintOpSettings(KisResourcesInterfaceSP resourcesInterface)
static QPainterPath makeTiltIndicator(KisPaintInformation const &info, QPointF const &start, qreal lengthScale, qreal angle)
static KisOptimizedBrushOutline ellipseOutline(qreal width, qreal height, qreal scale, qreal rotation)
bool read(const KisPropertiesConfiguration *setting)
bool getBool(const QString &name, bool def=false) const