summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2017-08-12 13:53:02 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2017-08-12 13:53:02 +0000
commit5cd1e00f9821f653dbc354ecb8a7c0e94bfc29c6 (patch)
tree5af16c6e2ae39acc3996354eb470ffbd2684d644
parentshortcuts: comp function should take values of input variables (attempt to fi... (diff)
downloadinkscape-5cd1e00f9821f653dbc354ecb8a7c0e94bfc29c6.tar.gz
inkscape-5cd1e00f9821f653dbc354ecb8a7c0e94bfc29c6.zip
Add flatten button to simplify, bspline and spiro. Need to rerun cmake because file changed
-rw-r--r--share/icons/flatten.svg21
-rw-r--r--share/icons/flatten_simplify.svg31
-rw-r--r--share/icons/symbolic_icons.svg2
-rw-r--r--share/icons/tango_icons.svg2
-rw-r--r--share/ui/select-toolbar.ui4
-rw-r--r--src/widgets/pencil-toolbar.cpp80
6 files changed, 102 insertions, 38 deletions
diff --git a/share/icons/flatten.svg b/share/icons/flatten.svg
new file mode 100644
index 000000000..94627ed3f
--- /dev/null
+++ b/share/icons/flatten.svg
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" id="svg1" width="15.721" height="15.721" version="1.1" sodipodi:docname="flatten.svg" inkscape:version="0.92.1 r15371">
+<metadata id="metadata867">
+<rdf:RDF>
+<cc:Work rdf:about="">
+<dc:format>image/svg+xml</dc:format>
+<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+</cc:Work>
+</rdf:RDF>
+</metadata>
+<sodipodi:namedview id="base" showgrid="true" inkscape:zoom="21.69073" inkscape:cx="12.99196" inkscape:cy="12.22368" inkscape:window-width="1280" inkscape:window-height="960" inkscape:window-x="0" inkscape:window-y="27" inkscape:window-maximized="1" inkscape:current-layer="svg1">
+<inkscape:grid id="GridFromPre046Settings" type="xygrid" originx="0pt" originy="0pt" spacingx="1pt" spacingy="1pt" color="#3f3fff" empcolor="#3f3fff" opacity="0.15" empopacity="0.38" empspacing="5" />
+</sodipodi:namedview>
+<defs id="defs3" />
+<g id="flatten" inkscape:label="#flatten" transform="translate(-282.58109,-536.7323)">
+<rect height="15.721" id="rect13989" style="color:#000000;fill:none" width="15.721" x="282.5811" y="536.7323" />
+<path style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;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:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.58585024;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers fill stroke;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" d="m 286.58102,546.09837 -0.95063,1.26861 4.95148,3.71238 4.94985,-3.71238 -0.95063,-1.26861 -3.99922,2.99941 z" id="path869" inkscape:connector-curvature="0" />
+<path style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;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:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.58585024;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers fill stroke;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" d="m 286.58102,542.10244 -0.95063,1.2686 4.95148,3.71402 4.94985,-3.71402 -0.95063,-1.2686 -3.99922,3.00104 z" id="path4008" inkscape:connector-curvature="0" />
+<path style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;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:#000000;solid-opacity:1;vector-effect:none;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.58585024;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:markers fill stroke;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" d="m 286.58102,538.10814 -0.95063,1.2686 4.95148,3.71402 4.94985,-3.71402 -0.95063,-1.2686 -3.99922,3.00105 z" id="path4010" inkscape:connector-curvature="0" />
+</g>
+</svg>
diff --git a/share/icons/flatten_simplify.svg b/share/icons/flatten_simplify.svg
deleted file mode 100644
index 42564eb76..000000000
--- a/share/icons/flatten_simplify.svg
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://web.resource.org/cc/"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:xlink="http://www.w3.org/1999/xlink"
- xmlns:sodipodi="http://inkscape.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- id="svg1"
- width="15.721"
- height="15.721"
- >
- <sodipodi:namedview
- id="base"
- showgrid="true"
- gridspacingy="1pt"
- gridspacingx="1pt"
- gridoriginy="0pt"
- gridoriginx="0pt"
- />
- <defs id="defs3">
-
- </defs>
-<g id="flatten_simplify" inkscape:label="#flatten_simplify" transform="translate(-282.58109,-536.7323)">
- <rect height="15.721" id="rect13989" style="color:#000000;fill:none" width="15.721" x="282.5811" y="536.7323"/>
- <path d="M 530.5332 205.6113 A 1.9925 2.080405 0 0 0 528.6133 207.1426 C 527.6704 207.4134 526.7115 207.8353 525.7988 208.5332 C 525.5735 208.7058 525.3617 208.8398 525.1465 208.9844 A 1.9925 2.080405 0 0 0 523.8516 208.4824 A 1.9925 2.080405 0 0 0 521.8672 210.3984 C 520.9451 210.5699 520.1488 210.5515 519.4629 210.5469 L 519.4512 212.0469 C 520.1403 212.0516 521.1103 212.0612 522.2676 211.8223 A 1.9925 2.080405 0 0 0 523.8516 212.6445 A 1.9925 2.080405 0 0 0 525.8438 210.5645 A 1.9925 2.080405 0 0 0 525.8281 210.3281 C 526.1184 210.1416 526.4096 209.954 526.709 209.7246 C 527.3764 209.2142 528.069 208.8737 528.7617 208.6484 A 1.9925 2.080405 0 0 0 530.5332 209.7734 A 1.9925 2.080405 0 0 0 532.4453 208.2656 C 533.1733 208.2979 533.843 208.3555 534.3984 208.3555 L 534.3984 206.8555 C 533.9353 206.8555 533.1903 206.7721 532.3047 206.7402 A 1.9925 2.080405 0 0 0 530.5332 205.6113 z M 530.5332 206.7246 A 0.9260918 0.9669491 0 0 1 531.459 207.6914 A 0.9260918 0.9669491 0 0 1 530.5332 208.6582 A 0.9260918 0.9669491 0 0 1 529.6055 207.6914 A 0.9260918 0.9669491 0 0 1 530.5332 206.7246 z M 523.8516 209.5957 A 0.9260918 0.9669491 0 0 1 524.7773 210.5645 A 0.9260918 0.9669491 0 0 1 523.8516 211.5312 A 0.9260918 0.9669491 0 0 1 522.9258 210.5645 A 0.9260918 0.9669491 0 0 1 523.8516 209.5957 z " id="path14280" style="color:#000000;solid-opacity:1;fill:#000000;fill-rule:evenodd;stroke-width:1.5" transform="translate(-236.3605,335.8446)"/>
-</g>
-
-</svg>
diff --git a/share/icons/symbolic_icons.svg b/share/icons/symbolic_icons.svg
index 509d97c3e..3ad3785c2 100644
--- a/share/icons/symbolic_icons.svg
+++ b/share/icons/symbolic_icons.svg
@@ -3621,7 +3621,7 @@ inkscape:path-effect="#path-effect36695" striped for faster load
<rect style="color:#000000;display:inline;fill:none;stroke:none;stroke-width:1;marker:none" id="rect17937-7" width="15.721" height="15.721" x="284.9688" y="535.6099" />
<path style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;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:#000000;solid-opacity:1;fill:#666666;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:normal;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" d="m 290.1793,536.2979 c -0.7351,-0.02 -1.3963,0.2336 -1.8416,0.7418 -0.4453,0.5079 -0.6453,1.1819 -0.7277,1.8733 -0.165,1.3827 0.089,2.9888 0.3519,4.5721 0.2625,1.5832 0.5439,3.1441 0.5465,4.1601 0,0.5079 -0.082,0.854 -0.1453,0.9691 -0.064,0.115 -0.041,0.1361 -0.3174,0.1282 -0.6247,-0.018 -0.8383,-0.2559 -1.06,-0.7845 -0.2217,-0.5286 -0.3197,-1.3858 -0.2995,-2.2749 0.041,-1.7782 0.1181,-2.1383 0.1181,-2.1383 l -1.3819,-0.012 c 0,0 -0.034,0.44 -0.081,2.4977 -0.023,1.0288 -0.041,1.7085 0.3488,2.6369 0.3896,0.9284 1.2262,1.6826 2.3192,1.7143 0.6352,0.018 1.2607,-0.3347 1.5691,-0.8922 0.3084,-0.5575 0.3684,-1.1856 0.3668,-1.8493 0,-1.3269 -0.3139,-2.9046 -0.5719,-4.461 -0.258,-1.5566 -0.4523,-3.0895 -0.3384,-4.044 0.057,-0.4774 0.1784,-0.773 0.3189,-0.9332 0.1403,-0.1602 0.3293,-0.2738 0.7905,-0.2615 0.4549,0.012 0.691,0.1248 0.822,0.2393 0.131,0.1144 0.2075,0.2532 0.262,0.5316 0.109,0.5566 -0.012,1.5867 -0.2126,2.6612 -0.2001,1.0747 -0.4614,2.1843 -0.4372,3.2167 0.012,0.5163 0.098,1.0527 0.4133,1.5075 0.3153,0.4549 0.8398,0.7126 1.3954,0.7452 0.4606,0.027 0.881,-0.051 1.2367,-0.2735 0.3557,-0.2231 0.6121,-0.5902 0.7531,-0.9588 0.282,-0.7375 0.2377,-1.4817 0.2126,-2.157 -0.025,-0.6754 -0.041,-1.301 0.021,-1.5725 0.031,-0.1358 0.056,-0.155 0.057,-0.1555 6e-4,-6e-4 0.022,-0.034 0.2006,-0.029 0.218,0 0.2382,0.043 0.271,0.074 0.033,0.031 0.092,0.1224 0.1947,0.323 0.1022,0.2006 0.2482,0.5079 0.5375,0.7743 0.2893,0.2664 0.7035,0.4386 1.1723,0.4614 1.6094,-0.2758 2.284,-1.0042 3.4062,-0.084 l 0,-1.6613 c -1.4875,-0.7361 -2.2939,-0.161 -3.3448,0.1059 -0.2401,-0.012 -0.2878,-0.059 -0.3309,-0.099 -0.043,-0.04 -0.1003,-0.1294 -0.1991,-0.3231 -0.099,-0.1938 -0.2357,-0.493 -0.5181,-0.7606 -0.2825,-0.2676 -0.6959,-0.4362 -1.1528,-0.4495 -0.4137,-0.012 -0.8221,0.1078 -1.1305,0.388 -0.3084,0.2805 -0.4715,0.6683 -0.5524,1.0255 -0.162,0.7142 -0.091,1.4129 -0.067,2.0545 0.024,0.6418 -0.01,1.2067 -0.093,1.4289 -0.043,0.1112 -0.066,0.1378 -0.1273,0.176 -0.061,0.038 -0.1963,0.09 -0.4716,0.074 -0.2756,-0.016 -0.3064,-0.07 -0.3429,-0.1231 -0.037,-0.053 -0.098,-0.2166 -0.1048,-0.535 -0.015,-0.6367 0.2002,-1.72 0.4073,-2.8321 0.2071,-1.1119 0.4237,-2.265 0.2096,-3.3586 -0.1071,-0.5468 -0.3582,-1.0977 -0.792,-1.4767 -0.434,-0.379 -1.0001,-0.5617 -1.6605,-0.5794 z" id="path14318-5-3" inkscape:connector-curvature="0" sodipodi:nodetypes="cccccccccccccccccccccsccccccccccccsccccccccccccccccccccc" />
</g>
-<g transform="translate(95.92986,175.9614)" id="flatten_simplify" inkscape:label="#flatten_simplify">
+<g transform="translate(95.92986,175.9614)" id="flatten" inkscape:label="#flatten">
<rect y="536.7323" x="282.5811" height="15.721" width="15.721" id="rect13989" style="color:#000000;display:inline;fill:none;stroke:none;stroke-width:1;marker:none" />
<path inkscape:connector-curvature="0" style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;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:#000000;solid-opacity:1;fill:#666666;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" d="m 530.5332,205.6113 a 1.9925,2.080405 0 0 0 -1.9199,1.5313 c -0.9429,0.2708 -1.9018,0.6927 -2.8145,1.3906 -0.2253,0.1726 -0.4371,0.3066 -0.6523,0.4512 a 1.9925,2.080405 0 0 0 -1.2949,-0.502 1.9925,2.080405 0 0 0 -1.9844,1.916 c -0.9221,0.1715 -1.7184,0.1531 -2.4043,0.1485 l -0.012,1.5 c 0.6891,0 1.6591,0.014 2.8164,-0.2246 a 1.9925,2.080405 0 0 0 1.584,0.8222 1.9925,2.080405 0 0 0 1.9922,-2.08 1.9925,2.080405 0 0 0 -0.016,-0.2364 c 0.2903,-0.1865 0.5815,-0.3741 0.8809,-0.6035 0.6674,-0.5104 1.36,-0.8509 2.0527,-1.0762 a 1.9925,2.080405 0 0 0 1.7715,1.125 1.9925,2.080405 0 0 0 1.9121,-1.5078 c 0.728,0.032 1.3977,0.09 1.9531,0.09 l 0,-1.5 c -0.4631,0 -1.2081,-0.083 -2.0937,-0.1153 a 1.9925,2.080405 0 0 0 -1.7715,-1.1289 z m 0,1.1133 a 0.9260918,0.9669491 0 0 1 0.9258,0.9668 0.9260918,0.9669491 0 0 1 -0.9258,0.9668 0.9260918,0.9669491 0 0 1 -0.9277,-0.9668 0.9260918,0.9669491 0 0 1 0.9277,-0.9668 z m -6.6816,2.8711 a 0.9260918,0.9669491 0 0 1 0.9257,0.9688 0.9260918,0.9669491 0 0 1 -0.9257,0.9667 0.9260918,0.9669491 0 0 1 -0.9258,-0.9667 0.9260918,0.9669491 0 0 1 0.9258,-0.9688 z" transform="translate(-236.3605,335.8446)" id="path14280" />
</g>
diff --git a/share/icons/tango_icons.svg b/share/icons/tango_icons.svg
index f71b2ced3..f84715f69 100644
--- a/share/icons/tango_icons.svg
+++ b/share/icons/tango_icons.svg
@@ -5288,7 +5288,7 @@ http://www.inkscape.org/</dc:description>
<rect style="color:#000000;display:inline;fill:none;stroke:none;stroke-width:1;marker:none" id="rect17937-7" width="15.721" height="15.721" x="284.9688" y="535.6099" />
<path style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;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:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.3;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;paint-order:normal;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" d="m 290.1793,536.2979 c -0.7351,-0.02 -1.3963,0.2336 -1.8416,0.7418 -0.4453,0.5079 -0.6453,1.1819 -0.7277,1.8733 -0.165,1.3827 0.089,2.9888 0.3519,4.5721 0.2625,1.5832 0.5439,3.1441 0.5465,4.1601 0,0.5079 -0.082,0.854 -0.1453,0.9691 -0.064,0.115 -0.041,0.1361 -0.3174,0.1282 -0.6247,-0.018 -0.8383,-0.2559 -1.06,-0.7845 -0.2217,-0.5286 -0.3197,-1.3858 -0.2995,-2.2749 0.041,-1.7782 0.1181,-2.1383 0.1181,-2.1383 l -1.3819,-0.012 c 0,0 -0.034,0.44 -0.081,2.4977 -0.023,1.0288 -0.041,1.7085 0.3488,2.6369 0.3896,0.9284 1.2262,1.6826 2.3192,1.7143 0.6352,0.018 1.2607,-0.3347 1.5691,-0.8922 0.3084,-0.5575 0.3684,-1.1856 0.3668,-1.8493 0,-1.3269 -0.3139,-2.9046 -0.5719,-4.461 -0.258,-1.5566 -0.4523,-3.0895 -0.3384,-4.044 0.057,-0.4774 0.1784,-0.773 0.3189,-0.9332 0.1403,-0.1602 0.3293,-0.2738 0.7905,-0.2615 0.4549,0.012 0.691,0.1248 0.822,0.2393 0.131,0.1144 0.2075,0.2532 0.262,0.5316 0.109,0.5566 -0.012,1.5867 -0.2126,2.6612 -0.2001,1.0747 -0.4614,2.1843 -0.4372,3.2167 0.012,0.5163 0.098,1.0527 0.4133,1.5075 0.3153,0.4549 0.8398,0.7126 1.3954,0.7452 0.4606,0.027 0.881,-0.051 1.2367,-0.2735 0.3557,-0.2231 0.6121,-0.5902 0.7531,-0.9588 0.282,-0.7375 0.2377,-1.4817 0.2126,-2.157 -0.025,-0.6754 -0.041,-1.301 0.021,-1.5725 0.031,-0.1358 0.056,-0.155 0.057,-0.1555 6e-4,-6e-4 0.022,-0.034 0.2006,-0.029 0.218,0 0.2382,0.043 0.271,0.074 0.033,0.031 0.092,0.1224 0.1947,0.323 0.1022,0.2006 0.2482,0.5079 0.5375,0.7743 0.2893,0.2664 0.7035,0.4386 1.1723,0.4614 1.6094,-0.2758 2.284,-1.0042 3.4062,-0.084 l 0,-1.6613 c -1.4875,-0.7361 -2.2939,-0.161 -3.3448,0.1059 -0.2401,-0.012 -0.2878,-0.059 -0.3309,-0.099 -0.043,-0.04 -0.1003,-0.1294 -0.1991,-0.3231 -0.099,-0.1938 -0.2357,-0.493 -0.5181,-0.7606 -0.2825,-0.2676 -0.6959,-0.4362 -1.1528,-0.4495 -0.4137,-0.012 -0.8221,0.1078 -1.1305,0.388 -0.3084,0.2805 -0.4715,0.6683 -0.5524,1.0255 -0.162,0.7142 -0.091,1.4129 -0.067,2.0545 0.024,0.6418 -0.01,1.2067 -0.093,1.4289 -0.043,0.1112 -0.066,0.1378 -0.1273,0.176 -0.061,0.038 -0.1963,0.09 -0.4716,0.074 -0.2756,-0.016 -0.3064,-0.07 -0.3429,-0.1231 -0.037,-0.053 -0.098,-0.2166 -0.1048,-0.535 -0.015,-0.6367 0.2002,-1.72 0.4073,-2.8321 0.2071,-1.1119 0.4237,-2.265 0.2096,-3.3586 -0.1071,-0.5468 -0.3582,-1.0977 -0.792,-1.4767 -0.434,-0.379 -1.0001,-0.5617 -1.6605,-0.5794 z" id="path14318-5-3" inkscape:connector-curvature="0" sodipodi:nodetypes="cccccccccccccccccccccsccccccccccccsccccccccccccccccccccc" />
</g>
-<g transform="translate(-138.3021,-0.7322998)" id="flatten_simplify" inkscape:label="#flatten_simplify">
+<g transform="translate(-138.3021,-0.7322998)" id="flatten" inkscape:label="#flatten">
<rect y="536.7323" x="282.5811" height="15.721" width="15.721" id="rect13989" style="color:#000000;display:inline;fill:none;stroke:none;stroke-width:1;marker:none" />
<path inkscape:connector-curvature="0" style="color:#000000;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:medium;line-height:normal;font-family:sans-serif;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;baseline-shift:baseline;text-anchor:start;white-space:normal;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:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate" d="m 530.5332,205.6113 a 1.9925,2.080405 0 0 0 -1.9199,1.5313 c -0.9429,0.2708 -1.9018,0.6927 -2.8145,1.3906 -0.2253,0.1726 -0.4371,0.3066 -0.6523,0.4512 a 1.9925,2.080405 0 0 0 -1.2949,-0.502 1.9925,2.080405 0 0 0 -1.9844,1.916 c -0.9221,0.1715 -1.7184,0.1531 -2.4043,0.1485 l -0.012,1.5 c 0.6891,0 1.6591,0.014 2.8164,-0.2246 a 1.9925,2.080405 0 0 0 1.584,0.8222 1.9925,2.080405 0 0 0 1.9922,-2.08 1.9925,2.080405 0 0 0 -0.016,-0.2364 c 0.2903,-0.1865 0.5815,-0.3741 0.8809,-0.6035 0.6674,-0.5104 1.36,-0.8509 2.0527,-1.0762 a 1.9925,2.080405 0 0 0 1.7715,1.125 1.9925,2.080405 0 0 0 1.9121,-1.5078 c 0.728,0.032 1.3977,0.09 1.9531,0.09 l 0,-1.5 c -0.4631,0 -1.2081,-0.083 -2.0937,-0.1153 a 1.9925,2.080405 0 0 0 -1.7715,-1.1289 z m 0,1.1133 a 0.9260918,0.9669491 0 0 1 0.9258,0.9668 0.9260918,0.9669491 0 0 1 -0.9258,0.9668 0.9260918,0.9669491 0 0 1 -0.9277,-0.9668 0.9260918,0.9669491 0 0 1 0.9277,-0.9668 z m -6.6816,2.8711 a 0.9260918,0.9669491 0 0 1 0.9257,0.9688 0.9260918,0.9669491 0 0 1 -0.9257,0.9667 0.9260918,0.9669491 0 0 1 -0.9258,-0.9667 0.9260918,0.9669491 0 0 1 0.9258,-0.9688 z" transform="translate(-236.3605,335.8446)" id="path14280" />
</g>
diff --git a/share/ui/select-toolbar.ui b/share/ui/select-toolbar.ui
index 42990ea32..d1fc779e8 100644
--- a/share/ui/select-toolbar.ui
+++ b/share/ui/select-toolbar.ui
@@ -200,12 +200,16 @@
<toolbar name='PenToolbar'>
<toolitem action='FreehandModeActionPen' />
<separator />
+ <toolitem action='FlattenSpiroBsplinePen' />
+ <separator />
<toolitem action='SetPenShapeAction'/>
</toolbar>
<toolbar name='PencilToolbar'>
<toolitem action='FreehandModeActionPencil' />
<separator />
+ <toolitem action='FlattenSpiroBsplinePencil' />
+ <separator />
<toolitem action='PencilToleranceAction' />
<toolitem action='PencilLpeSimplify' />
<toolitem action='PencilLpeSimplifyFlatten' />
diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp
index 918a54991..b15cc5b30 100644
--- a/src/widgets/pencil-toolbar.cpp
+++ b/src/widgets/pencil-toolbar.cpp
@@ -48,6 +48,8 @@
#include "display/curve.h"
#include "live_effects/lpe-simplify.h"
#include "live_effects/lpe-powerstroke.h"
+#include "live_effects/lpe-bspline.h"
+#include "live_effects/lpe-spiro.h"
#include "live_effects/lpeobject.h"
#include "live_effects/lpeobject-reference.h"
@@ -58,7 +60,7 @@ using Inkscape::UI::PrefPusher;
//########################
//## Pen/Pencil ##
//########################
-
+static void sp_flatten_spiro_bspline(GtkWidget * /*widget*/, GObject *obj);
/* This is used in generic functions below to share large portions of code between pen and pencil tool */
static Glib::ustring const freehand_tool_name(GObject *dataKludge)
{
@@ -74,7 +76,6 @@ static void freehand_mode_changed(EgeSelectOneAction* act, GObject* tbl)
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
prefs->setInt(freehand_tool_name(tbl) + "/freehand-mode", mode);
-
SPDesktop *desktop = static_cast<SPDesktop *>(g_object_get_data(tbl, "desktop"));
// in pen tool we have more options than in pencil tool; if one of them was chosen, we do any
@@ -83,6 +84,11 @@ static void freehand_mode_changed(EgeSelectOneAction* act, GObject* tbl)
Inkscape::UI::Tools::PenTool *pc = SP_PEN_CONTEXT(desktop->event_context);
pc->setPolylineMode();
}
+ if (mode == 1 || mode == 2) {
+ gtk_action_set_visible( GTK_ACTION( g_object_get_data(tbl, "flatten_spiro_bspline") ), true );
+ } else {
+ gtk_action_set_visible( GTK_ACTION( g_object_get_data(tbl, "flatten_spiro_bspline") ), false );
+ }
}
static void sp_add_freehand_mode_toggle(GtkActionGroup* mainActions, GObject* holder, bool tool_is_pencil)
@@ -131,7 +137,7 @@ static void sp_add_freehand_mode_toggle(GtkActionGroup* mainActions, GObject* ho
2, INKSCAPE_ICON("path-mode-polyline-paraxial"),
-1 );
}
-
+
EgeSelectOneAction* act = ege_select_one_action_new(tool_is_pencil ?
"FreehandModeActionPencil" :
"FreehandModeActionPen",
@@ -148,6 +154,21 @@ static void sp_add_freehand_mode_toggle(GtkActionGroup* mainActions, GObject* ho
ege_select_one_action_set_active( act, freehandMode);
g_signal_connect_after( G_OBJECT(act), "changed", G_CALLBACK(freehand_mode_changed), holder);
}
+ /* LPE bspline spiro flatten */
+ InkAction* inky = ink_action_new( tool_is_pencil ? "FlattenSpiroBsplinePencil" :
+ "FlattenSpiroBsplinePen",
+ _("LPE spiro or bspline flatten"),
+ _("LPE spiro or bspline flatten"),
+ INKSCAPE_ICON("flatten"),
+ GTK_ICON_SIZE_SMALL_TOOLBAR );
+ g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_flatten_spiro_bspline), holder );
+ gtk_action_group_add_action( mainActions, GTK_ACTION(inky) );
+ g_object_set_data( holder, "flatten_spiro_bspline", inky );
+ if (freehandMode == 1 || freehandMode == 2) {
+ gtk_action_set_visible( GTK_ACTION( g_object_get_data(holder, "flatten_spiro_bspline") ), true );
+ } else {
+ gtk_action_set_visible( GTK_ACTION( g_object_get_data(holder, "flatten_spiro_bspline") ), false );
+ }
}
}
@@ -162,6 +183,11 @@ static void freehand_simplify_lpe(InkToggleAction* itact, GObject *dataKludge) {
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
prefs->setInt(freehand_tool_name(dataKludge) + "/simplify", simplify);
gtk_action_set_visible( GTK_ACTION( g_object_get_data(dataKludge, "flatten_simplify") ), simplify );
+ if (simplify) {
+ gtk_action_set_visible( GTK_ACTION( g_object_get_data(dataKludge, "flatten_simplify") ), true );
+ } else {
+ gtk_action_set_visible( GTK_ACTION( g_object_get_data(dataKludge, "flatten_simplify") ), false );
+ }
}
/**
@@ -234,6 +260,49 @@ static void sp_pencil_tb_defaults(GtkWidget * /*widget*/, GObject *obj)
spinbutton_defocus(tbl);
}
+static void sp_flatten_spiro_bspline(GtkWidget * /*widget*/, GObject *obj)
+{
+ SPDesktop *desktop = static_cast<SPDesktop *>(g_object_get_data(obj, "desktop"));
+ auto selected = desktop->getSelection()->items();
+ SPLPEItem* lpeitem = NULL;
+ for (auto it(selected.begin()); it != selected.end(); ++it){
+ lpeitem = dynamic_cast<SPLPEItem*>(*it);
+ if (lpeitem && lpeitem->hasPathEffect()){
+ PathEffectList lpelist = lpeitem->getEffectList();
+ PathEffectList::iterator i;
+ for (i = lpelist.begin(); i != lpelist.end(); ++i) {
+ LivePathEffectObject *lpeobj = (*i)->lpeobject;
+ if (lpeobj) {
+ Inkscape::LivePathEffect::Effect *lpe = lpeobj->get_lpe();
+ if (dynamic_cast<Inkscape::LivePathEffect::LPEBSpline *>(lpe) ||
+ dynamic_cast<Inkscape::LivePathEffect::LPESpiro *>(lpe))
+ {
+ SPShape * shape = dynamic_cast<SPShape *>(lpeitem);
+ if(shape){
+ SPCurve * c = shape->getCurveBeforeLPE();
+ lpe->doEffect(c);
+ lpeitem->setCurrentPathEffect(*i);
+ if (lpelist.size() > 1){
+ lpeitem->removeCurrentPathEffect(true);
+ shape->setCurveBeforeLPE(c);
+ } else {
+ lpeitem->removeCurrentPathEffect(false);
+ shape->setCurve(c,0);
+ }
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ if (lpeitem) {
+ desktop->getSelection()->remove(lpeitem->getRepr());
+ desktop->getSelection()->add(lpeitem->getRepr());
+ sp_lpe_item_update_patheffect(lpeitem, false, false);
+ }
+}
+
static void sp_simplify_flatten(GtkWidget * /*widget*/, GObject *obj)
{
SPDesktop *desktop = static_cast<SPDesktop *>(g_object_get_data(obj, "desktop"));
@@ -271,6 +340,7 @@ static void sp_simplify_flatten(GtkWidget * /*widget*/, GObject *obj)
if (lpeitem) {
desktop->getSelection()->remove(lpeitem->getRepr());
desktop->getSelection()->add(lpeitem->getRepr());
+ sp_lpe_item_update_patheffect(lpeitem, false, false);
}
}
@@ -419,13 +489,13 @@ void sp_pencil_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb
InkAction* inky = ink_action_new( "PencilLpeSimplifyFlatten",
_("LPE simplify flatten"),
_("LPE simplify flatten"),
- INKSCAPE_ICON("flatten_simplify"),
+ INKSCAPE_ICON("flatten"),
GTK_ICON_SIZE_SMALL_TOOLBAR );
g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_simplify_flatten), holder );
gtk_action_group_add_action( mainActions, GTK_ACTION(inky) );
g_object_set_data( holder, "flatten_simplify", inky );
if (!prefs->getInt("/tools/freehand/pencil/simplify", 0)) {
- gtk_action_set_visible( GTK_ACTION( g_object_get_data(holder, "flatten_simplify") ), false );
+ gtk_action_set_visible( GTK_ACTION( g_object_get_data(holder, "flatten_simplify") ), true );
}
}