Merge lp:~inkscape.dev/inkscape/flatten_base_lpe_pen_pencil into lp:~inkscape.dev/inkscape/trunk

Proposed by Jabiertxof
Status: Rejected
Rejected by: Jabiertxof
Proposed branch: lp:~inkscape.dev/inkscape/flatten_base_lpe_pen_pencil
Merge into: lp:~inkscape.dev/inkscape/trunk
Diff against target: 200 lines (+63/-46)
5 files modified
share/icons/icons.svg (+1/-1)
share/icons/symbolic_icons.svg (+1/-1)
share/icons/tango_icons.svg (+1/-1)
src/widgets/pencil-toolbar.cpp (+57/-42)
src/widgets/toolbox.cpp (+3/-1)
To merge this branch: bzr merge lp:~inkscape.dev/inkscape/flatten_base_lpe_pen_pencil
Reviewer Review Type Date Requested Status
Inkscape Developers Pending
Review via email: mp+281661@code.launchpad.net

Description of the change

Reuse of the flatten simplify button on the pencil tool, to flatten also Bspline and Spiro LPE. The button now is also in pen mode.

To post a comment you must log in.
Revision history for this message
su_v (suv-lp) wrote :

1) On OS X 10.7.5, with merge diff applied to trunk rev 14562, I get this warning on the console on each launch:

(inkscape:49906): Gtk-WARNING **: Refusing to add non-unique action 'FlattenAction' to action group 'main'

2) Maybe the tooltip could explain briefly that - unlike with 'Shift+Ctrl+C' - only the first path effect in the stack is "flattened" (path effects stacked onto Simplify, Spiro or Bspline via 'Shape' parameter are retained (Powerstroke, PaP)). On the other hand this might be obvious on second thought (to be honest I initially - before testing - failed to understand that there is a difference between the shortcut and the new button ;-) ).

3) Slightly confusing UX e.g. when drawing spiro paths:
- the user draws a spiro path with the bezier tool
- while the bezier tool is still active, he/she clicks on the button to 'flatten' the spiro
  (the path is still selected, and the bezier tool in Spiro mode still active)
- now the user continues to draw, and attempts to extend the current path by hovering and highlighting the end node of the previous path

--> failure to continue as expected (Inkscape can't extend non-spiro line with spiro path effect) without any indication in the UI since the drawing tools do not have status line messages which would indicate what type of path is currently selected (regular, with path effect(s)). With an active shape, the result seems even more unpredictable (with the local build, I don't see immediate canvas updates using spiro splines, only after ending the continued path).

The pen tool also may expose some erratic behavior with new paths drawn just after attempting to extend a flattened spiro+shape (e.g.'Triangle In') curve - if there has been no switching of tool contexts in-between. This is likely unrelated to the specific feature in this merge proposal, but possibly exposed to the user with the new button.

Revision history for this message
Jabiertxof (jabiertxof) wrote :

Thanks for the review. 1 and 2 has a "easy" fix. My proposal to 3 is switch pen/cil mode to bezier when flatten button is pressed. Whats your opinion? Maybe is a bad feature in UX point of view, maybe is better switch it to path effect list and add a flattern button to each LPE in list to flattern a LPE and previous in stack.

14564. By Jabiertxof <email address hidden>

Fix reports in merge request

14565. By Jabiertxof <email address hidden>

update to trunk

14566. By Jabiertxof <email address hidden>

Fix for tooltip text

Revision history for this message
Jabiertxof (jabiertxof) wrote :

Updated with the fix you proposed in IRC to un-select "flattened" paths. Also changed the tooltips and fixed the on start console messages.

Unmerged revisions

14566. By Jabiertxof <email address hidden>

Fix for tooltip text

14565. By Jabiertxof <email address hidden>

update to trunk

14564. By Jabiertxof <email address hidden>

Fix reports in merge request

14563. By Jabiertxof <email address hidden>

update to trunk

14562. By Jabiertxof <email address hidden>

Added feature, marc for merge

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'share/icons/icons.svg'
2--- share/icons/icons.svg 2015-10-28 13:40:01 +0000
3+++ share/icons/icons.svg 2016-01-10 21:42:36 +0000
4@@ -4300,7 +4300,7 @@
5 <path style="fill:none;stroke:#c8c8c8;stroke-width:1px;stroke-linecap:square" d="m 12.5,14.5 0,-9" id="path5602-7" />
6 <path style="fill:#ffffff;fill-rule:evenodd;stroke:url(#linearGradient5799-9);stroke-width:1px;stroke-linecap:round;stroke-linejoin:round" d="m 9.5,0.5 4,4 -4,0 0,-4 z" id="path4681-4" />
7 </g>
8-<g transform="translate(236.3605,-335.8446)" id="flatten_simplify" inkscape:label="#flatten_simplify">
9+<g transform="translate(236.3605,-335.8446)" id="flatten-basic" inkscape:label="#flatten-basic">
10 <rect y="536.7323" x="282.5811" height="15.721" width="15.721" id="rect13989" style="color:#000000;fill:none" />
11 <path style="color:#000000;solid-opacity:1;fill:#000000;fill-rule:evenodd;stroke-width:1.5" 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 " transform="translate(-236.3605,335.8446)" id="path14280" />
12 </g>
13
14=== modified file 'share/icons/symbolic_icons.svg'
15--- share/icons/symbolic_icons.svg 2015-07-27 00:04:29 +0000
16+++ share/icons/symbolic_icons.svg 2016-01-10 21:42:36 +0000
17@@ -3617,7 +3617,7 @@
18 <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" />
19 <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" />
20 </g>
21-<g transform="translate(95.92986,175.9614)" id="flatten_simplify" inkscape:label="#flatten_simplify">
22+<g transform="translate(95.92986,175.9614)" id="flatten-basic" inkscape:label="#flatten-basic">
23 <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" />
24 <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" />
25 </g>
26
27=== modified file 'share/icons/tango_icons.svg'
28--- share/icons/tango_icons.svg 2015-07-27 00:04:29 +0000
29+++ share/icons/tango_icons.svg 2016-01-10 21:42:36 +0000
30@@ -5288,7 +5288,7 @@
31 <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" />
32 <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" />
33 </g>
34-<g transform="translate(-138.3021,-0.7322998)" id="flatten_simplify" inkscape:label="#flatten_simplify">
35+<g transform="translate(-138.3021,-0.7322998)" id="flatten-basic" inkscape:label="#flatten-basic">
36 <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" />
37 <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" />
38 </g>
39
40=== modified file 'src/widgets/pencil-toolbar.cpp'
41--- src/widgets/pencil-toolbar.cpp 2015-12-09 20:01:20 +0000
42+++ src/widgets/pencil-toolbar.cpp 2016-01-10 21:42:36 +0000
43@@ -48,6 +48,8 @@
44 #include "display/curve.h"
45 #include "live_effects/effect.h"
46 #include "live_effects/lpe-simplify.h"
47+#include "live_effects/lpe-bspline.h"
48+#include "live_effects/lpe-spiro.h"
49 #include "live_effects/lpe-powerstroke.h"
50 #include "live_effects/effect-enum.h"
51 #include "live_effects/lpeobject.h"
52@@ -88,6 +90,42 @@
53 }
54 }
55
56+static void sp_flatten_basic(GtkWidget * /*widget*/, GObject *obj)
57+{
58+ SPDesktop *desktop = static_cast<SPDesktop *>(g_object_get_data(obj, "desktop"));
59+ std::vector<SPItem *> selected = desktop->getSelection()->itemList();
60+ for (std::vector<SPItem *>::iterator it(selected.begin()); it != selected.end(); ++it){
61+ SPLPEItem* lpeitem = dynamic_cast<SPLPEItem*>(*it);
62+ if (lpeitem && lpeitem->hasPathEffect()){
63+ PathEffectList lpelist = lpeitem->getEffectList();
64+ std::list<Inkscape::LivePathEffect::LPEObjectReference *>::iterator i;
65+ for (i = lpelist.begin(); i != lpelist.end(); ++i) {
66+ LivePathEffectObject *lpeobj = (*i)->lpeobject;
67+ if (lpeobj) {
68+ Inkscape::LivePathEffect::Effect *lpe = lpeobj->get_lpe();
69+ if (dynamic_cast<Inkscape::LivePathEffect::LPESimplify *>(lpe) ||
70+ dynamic_cast<Inkscape::LivePathEffect::LPESpiro *>(lpe) ||
71+ dynamic_cast<Inkscape::LivePathEffect::LPEBSpline *>(lpe)) {
72+ SPShape * shape = dynamic_cast<SPShape *>(lpeitem);
73+ if(shape){
74+ SPCurve * c = shape->getCurveBeforeLPE();
75+ lpe->doEffect(c);
76+ lpeitem->setCurrentPathEffect(*i);
77+ if (lpelist.size() > 1){
78+ lpeitem->removeCurrentPathEffect(true);
79+ shape->setCurveBeforeLPE(c);
80+ } else {
81+ lpeitem->removeCurrentPathEffect(false);
82+ shape->setCurve(c,0);
83+ }
84+ }
85+ }
86+ }
87+ }
88+ desktop->getSelection()->remove(lpeitem);
89+ }
90+ }
91+}
92 static void sp_add_freehand_mode_toggle(GtkActionGroup* mainActions, GObject* holder, bool tool_is_pencil)
93 {
94 /* Freehand mode toggle buttons */
95@@ -134,7 +172,18 @@
96 2, INKSCAPE_ICON("path-mode-polyline-paraxial"),
97 -1 );
98 }
99-
100+ if (!tool_is_pencil) {
101+ /* Flatten Basic LPE */
102+ {
103+ InkAction* inky = ink_action_new( "FlattenPenAction",
104+ _("Flatten spiro or bspline live effect if exist on selected paths"),
105+ _("Flatten spiro or bspline live effect if exist on selected paths"),
106+ INKSCAPE_ICON("flatten-basic"),
107+ Inkscape::ICON_SIZE_SMALL_TOOLBAR );
108+ g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_flatten_basic), holder );
109+ gtk_action_group_add_action( mainActions, GTK_ACTION(inky) );
110+ }
111+ }
112 EgeSelectOneAction* act = ege_select_one_action_new(tool_is_pencil ?
113 "FreehandModeActionPencil" :
114 "FreehandModeActionPen",
115@@ -236,41 +285,6 @@
116 spinbutton_defocus(tbl);
117 }
118
119-static void sp_simplify_flatten(GtkWidget * /*widget*/, GObject *obj)
120-{
121- SPDesktop *desktop = static_cast<SPDesktop *>(g_object_get_data(obj, "desktop"));
122- std::vector<SPItem *> selected = desktop->getSelection()->itemList();
123- for (std::vector<SPItem *>::iterator it(selected.begin()); it != selected.end(); ++it){
124- SPLPEItem* lpeitem = dynamic_cast<SPLPEItem*>(*it);
125- if (lpeitem && lpeitem->hasPathEffect()){
126- PathEffectList lpelist = lpeitem->getEffectList();
127- std::list<Inkscape::LivePathEffect::LPEObjectReference *>::iterator i;
128- for (i = lpelist.begin(); i != lpelist.end(); ++i) {
129- LivePathEffectObject *lpeobj = (*i)->lpeobject;
130- if (lpeobj) {
131- Inkscape::LivePathEffect::Effect *lpe = lpeobj->get_lpe();
132- if (dynamic_cast<Inkscape::LivePathEffect::LPESimplify *>(lpe)) {
133- SPShape * shape = dynamic_cast<SPShape *>(lpeitem);
134- if(shape){
135- SPCurve * c = shape->getCurveBeforeLPE();
136- lpe->doEffect(c);
137- lpeitem->setCurrentPathEffect(*i);
138- if (lpelist.size() > 1){
139- lpeitem->removeCurrentPathEffect(true);
140- shape->setCurveBeforeLPE(c);
141- } else {
142- lpeitem->removeCurrentPathEffect(false);
143- shape->setCurve(c,0);
144- }
145- break;
146- }
147- }
148- }
149- }
150- }
151- }
152-}
153-
154 static void sp_pencil_tb_tolerance_value_changed(GtkAdjustment *adj, GObject *tbl)
155 {
156 // quit if run by the attr_changed listener
157@@ -411,14 +425,15 @@
158 g_signal_connect_after( G_OBJECT(itact), "toggled", G_CALLBACK(freehand_simplify_lpe), holder) ;
159 gtk_action_group_add_action( mainActions, GTK_ACTION(itact) );
160 }
161- /* LPE simplify flatten */
162+
163+ /* Flatten Basic LPE*/
164 {
165- InkAction* inky = ink_action_new( "PencilLpeSimplifyFlatten",
166- _("LPE simplify flatten"),
167- _("LPE simplify flatten"),
168- INKSCAPE_ICON("flatten_simplify"),
169+ InkAction* inky = ink_action_new( "FlattenPencilAction",
170+ _("Flatten simplify and spiro or bspline live effect if exist on selected paths"),
171+ _("Flatten simplify and spiro or bspline live effect if exist on selected paths"),
172+ INKSCAPE_ICON("flatten-basic"),
173 Inkscape::ICON_SIZE_SMALL_TOOLBAR );
174- g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_simplify_flatten), holder );
175+ g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_flatten_basic), holder );
176 gtk_action_group_add_action( mainActions, GTK_ACTION(inky) );
177 }
178
179
180=== modified file 'src/widgets/toolbox.cpp'
181--- src/widgets/toolbox.cpp 2015-12-07 20:18:04 +0000
182+++ src/widgets/toolbox.cpp 2016-01-10 21:42:36 +0000
183@@ -428,6 +428,8 @@
184 " <toolbar name='PenToolbar'>"
185 " <toolitem action='FreehandModeActionPen' />"
186 " <separator />"
187+ " <toolitem action='FlattenPenAction' />"
188+ " <separator />"
189 " <toolitem action='SetPenShapeAction'/>"
190 " </toolbar>"
191
192@@ -436,7 +438,7 @@
193 " <separator />"
194 " <toolitem action='PencilToleranceAction' />"
195 " <toolitem action='PencilLpeSimplify' />"
196- " <toolitem action='PencilLpeSimplifyFlatten' />"
197+ " <toolitem action='FlattenPencilAction' />"
198 " <separator />"
199 " <toolitem action='PencilResetAction' />"
200 " <separator />"