Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Add proper action for set_simple_smoothing

Halla Rempt9f251336d9e6
diff --git a/krita/krita.action b/krita/krita.action
index d92300d37c..0169db00f2 100644
--- a/krita/krita.action
+++ b/krita/krita.action
@@ -842,6 +842,16 @@
<isCheckable>false</isCheckable>
<statusTip/>
</Action>
+ <Action name="set_simple_pixel_smoothing">
+ <icon>smoothing-pixel</icon>
+ <text>Brush Smoothing: Pixel</text>
+ <whatsThis/>
+ <toolTip>Brush Smoothing: Pixel</toolTip>
+ <iconText>Brush Smoothing: Pixel</iconText>
+ <shortcut/>
+ <isCheckable>false</isCheckable>
+ <statusTip/>
+ </Action>
<Action name="set_stabilizer_brush_smoothing">
<icon>smoothing-stabilizer</icon>
<text>Brush Smoothing: Stabilizer</text>
diff --git a/krita/pics/svg/dark_smoothing-pixel.svg b/krita/pics/svg/dark_smoothing-pixel.svg
new file mode 100644
index 0000000000..eaf991f52c
--- /dev/null
+++ b/krita/pics/svg/dark_smoothing-pixel.svg
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--Created with Inkscape (http://www.inkscape.org/)-->
+
+<svg
+ width="22"
+ height="22"
+ id="svg2"
+ version="1.1"
+ inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
+ viewBox="0 0 22 22"
+ sodipodi:docname="dark_smoothing-pixel.svg"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <defs
+ id="defs19" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="23.069359"
+ inkscape:cx="-11.248687"
+ inkscape:cy="9.8615657"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ borderlayer="true"
+ inkscape:showpageshadow="false"
+ inkscape:window-width="2560"
+ inkscape:window-height="1364"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:pagecheckerboard="0">
+ <sodipodi:guide
+ position="2,20.000017"
+ orientation="18,0"
+ id="guide4066"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ position="2,2.0000174"
+ orientation="0,18"
+ id="guide4068"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ position="20,2.0000174"
+ orientation="-18,0"
+ id="guide4070"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ position="20,20.000017"
+ orientation="0,-18"
+ id="guide4072"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ position="3,19.000017"
+ orientation="16,0"
+ id="guide4074"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ position="3,3.0000174"
+ orientation="0,16"
+ id="guide4076"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ position="19,3.0000174"
+ orientation="-16,0"
+ id="guide4078"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ position="19,19.000017"
+ orientation="0,-16"
+ id="guide4080"
+ inkscape:locked="false" />
+ <inkscape:grid
+ type="xygrid"
+ id="grid4101" />
+ <sodipodi:guide
+ position="8,19.000017"
+ orientation="0,-5"
+ id="guide4124"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ position="11,3.0000174"
+ orientation="0,4"
+ id="guide4241"
+ inkscape:locked="false" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work>
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:date>2017</dc:date>
+ <dc:creator>
+ <cc:Agent>
+ <dc:title>Timothée Giet</dc:title>
+ </cc:Agent>
+ </dc:creator>
+ <cc:license
+ rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
+ </cc:Work>
+ <cc:License
+ rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#Reproduction" />
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#Distribution" />
+ <cc:requires
+ rdf:resource="http://creativecommons.org/ns#Notice" />
+ <cc:requires
+ rdf:resource="http://creativecommons.org/ns#Attribution" />
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
+ <cc:requires
+ rdf:resource="http://creativecommons.org/ns#ShareAlike" />
+ </cc:License>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Capa 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0 -1030.362)">
+ <path
+ style="fill:#373737;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M10 1035.362c0-3-5-3-5 0s7.006 6.957 7 12c-.006 5.043-10 4-10 1 0 2 6.983 2.044 7-1 .022-4-7-8-7-12s8-5 8 0z"
+ id="path4501"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cczcscc" />
+ <ellipse
+ style="color:#000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000;solid-opacity:1;fill:#373737;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ id="path4572"
+ cx="17.5"
+ cy="1035.8622"
+ rx="2.5"
+ ry="2.4999995" />
+ <rect
+ style="fill:#373737;fill-opacity:1"
+ id="rect892"
+ width="5"
+ height="5"
+ x="15"
+ y="1033.3621" />
+ </g>
+</svg>
diff --git a/krita/pics/svg/light_smoothing-pixel.svg b/krita/pics/svg/light_smoothing-pixel.svg
new file mode 100644
index 0000000000..00a6972957
--- /dev/null
+++ b/krita/pics/svg/light_smoothing-pixel.svg
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!--Created with Inkscape (http://www.inkscape.org/)-->
+
+<svg
+ width="22"
+ height="22"
+ id="svg2"
+ version="1.1"
+ inkscape:version="1.1.2 (0a00cf5339, 2022-02-04)"
+ viewBox="0 0 22 22"
+ sodipodi:docname="light_smoothing-pixel.svg"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <defs
+ id="defs19" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="23.069359"
+ inkscape:cx="-11.248687"
+ inkscape:cy="10.013282"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ units="px"
+ borderlayer="true"
+ inkscape:showpageshadow="false"
+ inkscape:window-width="2560"
+ inkscape:window-height="1364"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="1"
+ inkscape:pagecheckerboard="0">
+ <sodipodi:guide
+ position="2,20.000017"
+ orientation="18,0"
+ id="guide4066"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ position="2,2.0000174"
+ orientation="0,18"
+ id="guide4068"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ position="20,2.0000174"
+ orientation="-18,0"
+ id="guide4070"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ position="20,20.000017"
+ orientation="0,-18"
+ id="guide4072"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ position="3,19.000017"
+ orientation="16,0"
+ id="guide4074"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ position="3,3.0000174"
+ orientation="0,16"
+ id="guide4076"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ position="19,3.0000174"
+ orientation="-16,0"
+ id="guide4078"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ position="19,19.000017"
+ orientation="0,-16"
+ id="guide4080"
+ inkscape:locked="false" />
+ <inkscape:grid
+ type="xygrid"
+ id="grid4101" />
+ <sodipodi:guide
+ position="8,19.000017"
+ orientation="0,-5"
+ id="guide4124"
+ inkscape:locked="false" />
+ <sodipodi:guide
+ position="11,3.0000174"
+ orientation="0,4"
+ id="guide4241"
+ inkscape:locked="false" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work>
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:date>2017</dc:date>
+ <dc:creator>
+ <cc:Agent>
+ <dc:title>Timothée Giet</dc:title>
+ </cc:Agent>
+ </dc:creator>
+ <cc:license
+ rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
+ </cc:Work>
+ <cc:License
+ rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#Reproduction" />
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#Distribution" />
+ <cc:requires
+ rdf:resource="http://creativecommons.org/ns#Notice" />
+ <cc:requires
+ rdf:resource="http://creativecommons.org/ns#Attribution" />
+ <cc:permits
+ rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
+ <cc:requires
+ rdf:resource="http://creativecommons.org/ns#ShareAlike" />
+ </cc:License>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Capa 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(0 -1030.362)">
+ <path
+ style="fill:#d2d2d2;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+ d="M10 1035.362c0-3-5-3-5 0s7.006 6.957 7 12c-.006 5.043-10 4-10 1 0 2 6.983 2.044 7-1 .022-4-7-8-7-12s8-5 8 0z"
+ id="path4501"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cczcscc" />
+ <ellipse
+ style="color:#000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000;solid-opacity:1;fill:#d2d2d2;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+ id="path4572"
+ cx="17.5"
+ cy="1035.8622"
+ rx="2.5"
+ ry="2.4999995" />
+ <rect
+ style="fill:#d2d2d2;fill-opacity:1"
+ id="rect43"
+ width="5"
+ height="5.0000172"
+ x="15"
+ y="1033.3619" />
+ </g>
+</svg>
diff --git a/krita/pics/svg/svg-icons.qrc b/krita/pics/svg/svg-icons.qrc
index 7303028c71..59b63e4c7d 100644
--- a/krita/pics/svg/svg-icons.qrc
+++ b/krita/pics/svg/svg-icons.qrc
@@ -267,11 +267,13 @@
<file>light_rotation-reset.svg</file>
<file alias="light_reset_canvas_rotation.svg">light_rotation-reset.svg</file>
<file>light_smoothing-basic.svg</file>
+ <file>light_smoothing-pixel.svg</file>
<file>light_smoothing-no.svg</file>
<file>light_smoothing-stabilizer.svg</file>
<file>light_smoothing-weighted.svg</file>
<file>dark_smoothing-basic.svg</file>
<file>dark_smoothing-no.svg</file>
+ <file>dark_smoothing-pixel.svg</file>
<file>dark_smoothing-stabilizer.svg</file>
<file>dark_smoothing-weighted.svg</file>
<file>light_merge-layer-below.svg</file>
diff --git a/libs/ui/tool/kis_smoothing_options.h b/libs/ui/tool/kis_smoothing_options.h
index 16208d0ae6..85b2853bde 100644
--- a/libs/ui/tool/kis_smoothing_options.h
+++ b/libs/ui/tool/kis_smoothing_options.h
@@ -20,6 +20,7 @@ public:
enum SmoothingType {
NO_SMOOTHING = 0,
SIMPLE_SMOOTHING,
+ SIMPLE_PIXEL_SMOOTHING,
WEIGHTED_SMOOTHING,
STABILIZER,
PIXEL_PERFECT
diff --git a/plugins/tools/basictools/kis_tool_brush.cc b/plugins/tools/basictools/kis_tool_brush.cc
index 923a04c3b5..d11aa52c5a 100644
--- a/plugins/tools/basictools/kis_tool_brush.cc
+++ b/plugins/tools/basictools/kis_tool_brush.cc
@@ -61,6 +61,7 @@ KisToolBrush::KisToolBrush(KoCanvasBase * canvas)
connect(this, SIGNAL(smoothingTypeChanged()), this, SLOT(resetCursorStyle()));
addSmoothingAction(KisSmoothingOptions::NO_SMOOTHING, "set_no_brush_smoothing");
+ addSmoothingAction(KisSmoothingOptions::SIMPLE_PIXEL_SMOOTHING, "set_simple_pixel_smoothing");
addSmoothingAction(KisSmoothingOptions::SIMPLE_SMOOTHING, "set_simple_brush_smoothing");
addSmoothingAction(KisSmoothingOptions::WEIGHTED_SMOOTHING, "set_weighted_brush_smoothing");
addSmoothingAction(KisSmoothingOptions::PIXEL_PERFECT, "set_simple_brush_smoothing");