Merge lp:~inkscape.dev/inkscape/simplify-lpe-pencil-toolbar into lp:~inkscape.dev/inkscape/trunk

Proposed by Jabiertxof on 2015-03-08
Status: Merged
Approved by: Jabiertxof on 2015-07-26
Approved revision: 13993
Merged at revision: 14259
Proposed branch: lp:~inkscape.dev/inkscape/simplify-lpe-pencil-toolbar
Merge into: lp:~inkscape.dev/inkscape/trunk
Diff against target: 217 lines (+90/-4)
7 files modified
share/icons/icons.svg (+4/-0)
share/icons/symbolic_icons.svg (+4/-0)
share/icons/tango_icons.svg (+4/-0)
src/ui/tools/freehand-base.cpp (+24/-0)
src/ui/tools/pencil-tool.cpp (+10/-4)
src/widgets/pencil-toolbar.cpp (+43/-0)
src/widgets/toolbox.cpp (+1/-0)
To merge this branch: bzr merge lp:~inkscape.dev/inkscape/simplify-lpe-pencil-toolbar
Reviewer Review Type Date Requested Status
Inkscape Developers 2015-03-08 Pending
Review via email: mp+252223@code.launchpad.net

Description of the change

This branch add interactive smooth to paths whith the pencil tool

To post a comment you must log in.
Jabiertxof (jabiertxof) wrote :
13977. By Jabiertxof <email address hidden> on 2015-03-08

fixing icons and update to trunk

13978. By Jabiertxof <email address hidden> on 2015-03-08

fix to fit the new parameters of simplify lpe

13979. By Jabiertxof <email address hidden> on 2015-03-09

update to trunk

13980. By Jabiertxof <email address hidden> on 2015-03-09

Fix new added simplify parameter

13981. By Jabiertxof <email address hidden> on 2015-03-10

update to trunk

13982. By Jabiertxof <email address hidden> on 2015-03-10

Update to new simplify

13983. By Jabiertxof <email address hidden> on 2015-03-18

update to trunk

13984. By Jabiertxof <email address hidden> on 2015-04-09

update to trunk

13985. By Jabiertxof <email address hidden> on 2015-04-09

astyle simplify LPE

13986. By Jabiertxof <email address hidden> on 2015-04-09

Coding style fixes

13987. By Jabiertxof <email address hidden> on 2015-04-09

fix a bug in refactor

13988. By Jabiertxof <email address hidden> on 2015-07-24

update to trunk

13989. By Jabiertxof <email address hidden> on 2015-07-24

change from list to vector

13990. By Jabiertxof <email address hidden> on 2015-07-25

updated icons

13991. By Jabiertxof <email address hidden> on 2015-07-25

fix icons

njh (njh-njhurst) :
13992. By Jabiertxof <email address hidden> on 2015-07-25

Removes extra unnecesary code pointed by Nathan Hurst

13993. By Jabiertxof <email address hidden> on 2015-07-25

update to trunk

Jabiertxof (jabiertxof) wrote :

Hi Nathan. Fixed, this check is from the previous code in std::list.

Jabiertxof (jabiertxof) wrote :

Ah, I just update this part of code from list to vector and dont view it. Thanks, now is fixed.
Thanks very much for the review!

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-07-05 10:49:45 +0000
3+++ share/icons/icons.svg 2015-07-25 19:13:01 +0000
4@@ -3954,4 +3954,8 @@
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 inkscape:label="#interactive_simplify" id="interactive_simplify-8" transform="translate(2.8103663,-3.4622352)">
9+<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.96881" y="535.60986"/>
10+<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:#1a1a1a;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1.29999995;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.17927,536.29791 c -0.73508,-0.0198 -1.39622,0.2336 -1.84159,0.74177 -0.44531,0.50792 -0.64525,1.18194 -0.72765,1.87328 -0.16506,1.38275 0.0895,2.98886 0.35184,4.5721 0.26249,1.58323 0.54397,3.14418 0.5465,4.16017 0.002,0.50783 -0.0816,0.85395 -0.14524,0.96912 -0.0636,0.11498 -0.0413,0.13606 -0.31741,0.12818 -0.62469,-0.018 -0.83827,-0.25596 -1.06003,-0.78451 -0.2217,-0.52866 -0.31969,-1.38583 -0.29946,-2.27495 0.0406,-1.77813 0.11807,-2.13825 0.11807,-2.13825 l -1.38194,-0.0121 c 0,0 -0.0337,0.44001 -0.0806,2.49766 -0.0235,1.02877 -0.0407,1.70852 0.34882,2.63692 0.38958,0.92839 1.22621,1.68264 2.3192,1.71432 0.63526,0.0182 1.2607,-0.33475 1.56909,-0.89219 0.30839,-0.55754 0.36843,-1.18568 0.36682,-1.84935 -0.004,-1.32684 -0.31391,-2.90454 -0.57194,-4.461 -0.25796,-1.55655 -0.45229,-3.08947 -0.33837,-4.04395 0.057,-0.47747 0.17846,-0.77307 0.3189,-0.93322 0.14036,-0.16024 0.32929,-0.27384 0.79054,-0.2615 0.45488,0.0122 0.69097,0.12483 0.82198,0.23928 0.13101,0.11437 0.20751,0.2532 0.26202,0.53156 0.109,0.55665 -0.0124,1.58674 -0.21261,2.6612 -0.20016,1.07473 -0.46142,2.18434 -0.43719,3.21672 0.0121,0.5163 0.098,1.05271 0.41323,1.5075 0.31537,0.45497 0.8398,0.71265 1.39541,0.74522 0.46064,0.0271 0.88102,-0.0505 1.23672,-0.27349 0.35569,-0.22306 0.61213,-0.59016 0.7531,-0.95885 0.28203,-0.73745 0.23775,-1.48168 0.21261,-2.157 -0.025,-0.67532 -0.0407,-1.30092 0.021,-1.57246 0.0307,-0.13582 0.0562,-0.15501 0.0568,-0.15554 6.1e-4,-5.1e-4 0.0216,-0.0342 0.20063,-0.029 0.21794,0.005 0.23819,0.0425 0.27101,0.0736 0.0328,0.031 0.0923,0.12248 0.19463,0.32304 0.10226,0.20058 0.24827,0.50789 0.53749,0.77427 0.28932,0.26646 0.7035,0.43865 1.17233,0.46148 1.60943,-0.27583 2.28398,-1.00425 3.4062,-0.0836 l 0,-1.66134 c -1.4875,-0.73615 -2.29389,-0.16099 -3.3448,0.10586 -0.24009,-0.0116 -0.2878,-0.0595 -0.33089,-0.0991 -0.0432,-0.0397 -0.1003,-0.12938 -0.19913,-0.32304 -0.0988,-0.19383 -0.23563,-0.49298 -0.51805,-0.76059 -0.28248,-0.26761 -0.69591,-0.43622 -1.15285,-0.44952 -0.41365,-0.0119 -0.82202,0.10779 -1.13042,0.388 -0.30846,0.28046 -0.47152,0.6683 -0.55246,1.0255 -0.16199,0.71419 -0.0912,1.41292 -0.0674,2.05446 0.0239,0.6418 -0.008,1.20669 -0.0929,1.42888 -0.0426,0.11125 -0.0664,0.13781 -0.12726,0.17604 -0.061,0.0384 -0.19635,0.0897 -0.47163,0.0736 -0.27557,-0.0162 -0.30637,-0.0703 -0.34286,-0.12306 -0.0366,-0.0526 -0.0975,-0.21662 -0.10481,-0.53499 -0.015,-0.63672 0.20013,-1.72004 0.40726,-2.83212 0.20712,-1.11192 0.4237,-2.26505 0.2096,-3.35858 -0.10709,-0.54685 -0.35815,-1.09774 -0.79203,-1.47675 -0.43396,-0.37901 -1.00009,-0.56172 -1.66043,-0.57941 z" id="path14318-5" inkscape:connector-curvature="0" sodipodi:nodetypes="cccccccccccccccccccccsccccccccccccsccccccccccccccccccccc"/>
11+</g>
12 </svg>
13
14=== modified file 'share/icons/symbolic_icons.svg'
15--- share/icons/symbolic_icons.svg 2015-04-20 23:11:13 +0000
16+++ share/icons/symbolic_icons.svg 2015-07-25 19:13:01 +0000
17@@ -3464,6 +3464,10 @@
18 <path inkscape:connector-curvature="0" style="fill:url(#linearGradient19282)" d="m 13.969,3 0,1 3,0 a 1,1 0 0 1 1,1 l 0,1 -2,0 2.5,3 2.5,-3 -2,0 0,-1 a 2,2 0 0 0 -2,-2 l -3,0 z" id="path40863-1" />
19 <path id="path40889-9" d="m 12.969,16 0,-1 -3,0 a 1,1 0 0 1 -1,-1 l 0,-1 2,0 -2.5,-3 -2.5,3 2,0 0,1 a 2,2 0 0 0 2,2 l 3,0 z" style="fill:url(#linearGradient19282)" inkscape:connector-curvature="0" />
20 </g>
21+<g inkscape:label="#interactive_simplify" id="interactive_simplify-8" transform="translate(2.8103663,-3.4622352)">
22+<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.96881" y="535.60986"/>
23+<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.29999995;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.17927,536.29791 c -0.73508,-0.0198 -1.39622,0.2336 -1.84159,0.74177 -0.44531,0.50792 -0.64525,1.18194 -0.72765,1.87328 -0.16506,1.38275 0.0895,2.98886 0.35184,4.5721 0.26249,1.58323 0.54397,3.14418 0.5465,4.16017 0.002,0.50783 -0.0816,0.85395 -0.14524,0.96912 -0.0636,0.11498 -0.0413,0.13606 -0.31741,0.12818 -0.62469,-0.018 -0.83827,-0.25596 -1.06003,-0.78451 -0.2217,-0.52866 -0.31969,-1.38583 -0.29946,-2.27495 0.0406,-1.77813 0.11807,-2.13825 0.11807,-2.13825 l -1.38194,-0.0121 c 0,0 -0.0337,0.44001 -0.0806,2.49766 -0.0235,1.02877 -0.0407,1.70852 0.34882,2.63692 0.38958,0.92839 1.22621,1.68264 2.3192,1.71432 0.63526,0.0182 1.2607,-0.33475 1.56909,-0.89219 0.30839,-0.55754 0.36843,-1.18568 0.36682,-1.84935 -0.004,-1.32684 -0.31391,-2.90454 -0.57194,-4.461 -0.25796,-1.55655 -0.45229,-3.08947 -0.33837,-4.04395 0.057,-0.47747 0.17846,-0.77307 0.3189,-0.93322 0.14036,-0.16024 0.32929,-0.27384 0.79054,-0.2615 0.45488,0.0122 0.69097,0.12483 0.82198,0.23928 0.13101,0.11437 0.20751,0.2532 0.26202,0.53156 0.109,0.55665 -0.0124,1.58674 -0.21261,2.6612 -0.20016,1.07473 -0.46142,2.18434 -0.43719,3.21672 0.0121,0.5163 0.098,1.05271 0.41323,1.5075 0.31537,0.45497 0.8398,0.71265 1.39541,0.74522 0.46064,0.0271 0.88102,-0.0505 1.23672,-0.27349 0.35569,-0.22306 0.61213,-0.59016 0.7531,-0.95885 0.28203,-0.73745 0.23775,-1.48168 0.21261,-2.157 -0.025,-0.67532 -0.0407,-1.30092 0.021,-1.57246 0.0307,-0.13582 0.0562,-0.15501 0.0568,-0.15554 6.1e-4,-5.1e-4 0.0216,-0.0342 0.20063,-0.029 0.21794,0.005 0.23819,0.0425 0.27101,0.0736 0.0328,0.031 0.0923,0.12248 0.19463,0.32304 0.10226,0.20058 0.24827,0.50789 0.53749,0.77427 0.28932,0.26646 0.7035,0.43865 1.17233,0.46148 1.60943,-0.27583 2.28398,-1.00425 3.4062,-0.0836 l 0,-1.66134 c -1.4875,-0.73615 -2.29389,-0.16099 -3.3448,0.10586 -0.24009,-0.0116 -0.2878,-0.0595 -0.33089,-0.0991 -0.0432,-0.0397 -0.1003,-0.12938 -0.19913,-0.32304 -0.0988,-0.19383 -0.23563,-0.49298 -0.51805,-0.76059 -0.28248,-0.26761 -0.69591,-0.43622 -1.15285,-0.44952 -0.41365,-0.0119 -0.82202,0.10779 -1.13042,0.388 -0.30846,0.28046 -0.47152,0.6683 -0.55246,1.0255 -0.16199,0.71419 -0.0912,1.41292 -0.0674,2.05446 0.0239,0.6418 -0.008,1.20669 -0.0929,1.42888 -0.0426,0.11125 -0.0664,0.13781 -0.12726,0.17604 -0.061,0.0384 -0.19635,0.0897 -0.47163,0.0736 -0.27557,-0.0162 -0.30637,-0.0703 -0.34286,-0.12306 -0.0366,-0.0526 -0.0975,-0.21662 -0.10481,-0.53499 -0.015,-0.63672 0.20013,-1.72004 0.40726,-2.83212 0.20712,-1.11192 0.4237,-2.26505 0.2096,-3.35858 -0.10709,-0.54685 -0.35815,-1.09774 -0.79203,-1.47675 -0.43396,-0.37901 -1.00009,-0.56172 -1.66043,-0.57941 z" id="path14318-5-3" inkscape:connector-curvature="0" sodipodi:nodetypes="cccccccccccccccccccccsccccccccccccsccccccccccccccccccccc"/>
24+</g>
25 <g id="stock_icons">
26 <g transform="translate(-270,23)" id="object-rotate-90-CW">
27 <g transform="translate(223.9998,725.3622)" id="g15895" inkscape:label="stock-rotate-270">
28
29=== modified file 'share/icons/tango_icons.svg'
30--- share/icons/tango_icons.svg 2015-03-08 16:44:59 +0000
31+++ share/icons/tango_icons.svg 2015-07-25 19:13:01 +0000
32@@ -5277,6 +5277,10 @@
33 <ellipse style="color:#000000;text-decoration:none;text-decoration-line:none;display:inline;overflow:visible;visibility:visible;fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" id="ellipse47662" cx="18.48884" cy="207.5353" rx="6.611154" ry="6.515604" transform="matrix(0.8723531,0,0,0.8723531,2.360043,26.49119)" />
34 <rect y="199.5352" x="10.48884" height="15.99999" width="15.99999" id="rect47664" style="color:#000000;display:inline;fill:none;stroke:none;stroke-width:0.531496;marker:none" />
35 </g>
36+<g inkscape:label="#interactive_simplify" id="interactive_simplify-8" transform="translate(2.8103663,-3.4622352)">
37+<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.96881" y="535.60986"/>
38+<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:#555753;fill-opacity:0.98823529;fill-rule:nonzero;stroke:none;stroke-width:1.29999995;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.17927,536.29791 c -0.73508,-0.0198 -1.39622,0.2336 -1.84159,0.74177 -0.44531,0.50792 -0.64525,1.18194 -0.72765,1.87328 -0.16506,1.38275 0.0895,2.98886 0.35184,4.5721 0.26249,1.58323 0.54397,3.14418 0.5465,4.16017 0.002,0.50783 -0.0816,0.85395 -0.14524,0.96912 -0.0636,0.11498 -0.0413,0.13606 -0.31741,0.12818 -0.62469,-0.018 -0.83827,-0.25596 -1.06003,-0.78451 -0.2217,-0.52866 -0.31969,-1.38583 -0.29946,-2.27495 0.0406,-1.77813 0.11807,-2.13825 0.11807,-2.13825 l -1.38194,-0.0121 c 0,0 -0.0337,0.44001 -0.0806,2.49766 -0.0235,1.02877 -0.0407,1.70852 0.34882,2.63692 0.38958,0.92839 1.22621,1.68264 2.3192,1.71432 0.63526,0.0182 1.2607,-0.33475 1.56909,-0.89219 0.30839,-0.55754 0.36843,-1.18568 0.36682,-1.84935 -0.004,-1.32684 -0.31391,-2.90454 -0.57194,-4.461 -0.25796,-1.55655 -0.45229,-3.08947 -0.33837,-4.04395 0.057,-0.47747 0.17846,-0.77307 0.3189,-0.93322 0.14036,-0.16024 0.32929,-0.27384 0.79054,-0.2615 0.45488,0.0122 0.69097,0.12483 0.82198,0.23928 0.13101,0.11437 0.20751,0.2532 0.26202,0.53156 0.109,0.55665 -0.0124,1.58674 -0.21261,2.6612 -0.20016,1.07473 -0.46142,2.18434 -0.43719,3.21672 0.0121,0.5163 0.098,1.05271 0.41323,1.5075 0.31537,0.45497 0.8398,0.71265 1.39541,0.74522 0.46064,0.0271 0.88102,-0.0505 1.23672,-0.27349 0.35569,-0.22306 0.61213,-0.59016 0.7531,-0.95885 0.28203,-0.73745 0.23775,-1.48168 0.21261,-2.157 -0.025,-0.67532 -0.0407,-1.30092 0.021,-1.57246 0.0307,-0.13582 0.0562,-0.15501 0.0568,-0.15554 6.1e-4,-5.1e-4 0.0216,-0.0342 0.20063,-0.029 0.21794,0.005 0.23819,0.0425 0.27101,0.0736 0.0328,0.031 0.0923,0.12248 0.19463,0.32304 0.10226,0.20058 0.24827,0.50789 0.53749,0.77427 0.28932,0.26646 0.7035,0.43865 1.17233,0.46148 1.60943,-0.27583 2.28398,-1.00425 3.4062,-0.0836 l 0,-1.66134 c -1.4875,-0.73615 -2.29389,-0.16099 -3.3448,0.10586 -0.24009,-0.0116 -0.2878,-0.0595 -0.33089,-0.0991 -0.0432,-0.0397 -0.1003,-0.12938 -0.19913,-0.32304 -0.0988,-0.19383 -0.23563,-0.49298 -0.51805,-0.76059 -0.28248,-0.26761 -0.69591,-0.43622 -1.15285,-0.44952 -0.41365,-0.0119 -0.82202,0.10779 -1.13042,0.388 -0.30846,0.28046 -0.47152,0.6683 -0.55246,1.0255 -0.16199,0.71419 -0.0912,1.41292 -0.0674,2.05446 0.0239,0.6418 -0.008,1.20669 -0.0929,1.42888 -0.0426,0.11125 -0.0664,0.13781 -0.12726,0.17604 -0.061,0.0384 -0.19635,0.0897 -0.47163,0.0736 -0.27557,-0.0162 -0.30637,-0.0703 -0.34286,-0.12306 -0.0366,-0.0526 -0.0975,-0.21662 -0.10481,-0.53499 -0.015,-0.63672 0.20013,-1.72004 0.40726,-2.83212 0.20712,-1.11192 0.4237,-2.26505 0.2096,-3.35858 -0.10709,-0.54685 -0.35815,-1.09774 -0.79203,-1.47675 -0.43396,-0.37901 -1.00009,-0.56172 -1.66043,-0.57941 z" id="path14318-5-3" inkscape:connector-curvature="0" sodipodi:nodetypes="cccccccccccccccccccccsccccccccccccsccccccccccccccccccccc"/>
39+</g>
40 <g style="display:inline" transform="translate(13.51115,137.9503)" id="off">
41 <ellipse style="color:#000000;text-decoration:none;text-decoration-line:none;display:inline;overflow:visible;visibility:visible;fill:#a40000;fill-opacity:1;fill-rule:evenodd;stroke:#8d8d8d;stroke-width:1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" id="ellipse47668" cx="18.48884" cy="190.0497" rx="6.611154" ry="6.515604" />
42 <path style="color:#000000;text-decoration:none;text-decoration-line:none;display:inline;overflow:visible;visibility:visible;fill:none;stroke:#ffffff;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate" d="M 15.90515,187.466 21.07254,192.6334" id="path47670" inkscape:connector-curvature="0" sodipodi:nodetypes="cc" inkscape:transform-center-x="-5.253213" inkscape:transform-center-y="3.571599" />
43
44=== modified file 'src/ui/tools/freehand-base.cpp'
45--- src/ui/tools/freehand-base.cpp 2015-07-22 20:25:18 +0000
46+++ src/ui/tools/freehand-base.cpp 2015-07-25 19:13:01 +0000
47@@ -21,6 +21,7 @@
48 #endif
49
50 #include "live_effects/lpe-patternalongpath.h"
51+#include "live_effects/lpe-simplify.h"
52 #include "display/canvas-bpath.h"
53 #include "xml/repr.h"
54 #include "svg/svg.h"
55@@ -266,6 +267,21 @@
56 lpe->getRepr()->setAttribute("offset_points", s.str().c_str());
57 }
58
59+static void spdc_apply_simplify(std::string threshold, FreehandBase *dc, SPItem *item)
60+{
61+ using namespace Inkscape::LivePathEffect;
62+
63+ Effect::createAndApply(SIMPLIFY, dc->desktop->doc(), item);
64+ Effect* lpe = SP_LPE_ITEM(item)->getCurrentLPE();
65+ // write powerstroke parameters:
66+ lpe->getRepr()->setAttribute("steps", "1");
67+ lpe->getRepr()->setAttribute("threshold", threshold);
68+ lpe->getRepr()->setAttribute("smooth_angles", "360");
69+ lpe->getRepr()->setAttribute("helper_size", "0");
70+ lpe->getRepr()->setAttribute("simplifyindividualpaths", "false");
71+ lpe->getRepr()->setAttribute("simplifyJustCoalesce", "false");
72+}
73+
74 static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item, SPCurve *curve)
75 {
76 using namespace Inkscape::LivePathEffect;
77@@ -287,6 +303,14 @@
78
79
80 shapeType shape = (shapeType)prefs->getInt(tool_name(dc) + "/shape", 0);
81+ bool simplify = prefs->getInt(tool_name(dc) + "/simplify", 0);
82+ if(simplify){
83+ double tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0);
84+ tol = tol/(100.0*(101.0-tol));
85+ std::ostringstream ss;
86+ ss << tol;
87+ spdc_apply_simplify(ss.str(), dc, item);
88+ }
89 bool shape_applied = false;
90 SPCSSAttr *css_item = sp_css_attr_from_object(item, SP_STYLE_FLAG_ALWAYS);
91 const char *cstroke = sp_repr_css_property(css_item, "stroke", "none");
92
93=== modified file 'src/ui/tools/pencil-tool.cpp'
94--- src/ui/tools/pencil-tool.cpp 2015-05-29 19:37:41 +0000
95+++ src/ui/tools/pencil-tool.cpp 2015-07-25 19:13:01 +0000
96@@ -635,8 +635,11 @@
97
98 Inkscape::Preferences *prefs = Inkscape::Preferences::get();
99 double const tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0) * 0.4;
100- double const tolerance_sq = 0.02 * square(this->desktop->w2d().descrim() * tol) * exp(0.2 * tol - 2);
101-
102+ double tolerance_sq = 0.02 * square(this->desktop->w2d().descrim() * tol) * exp(0.2 * tol - 2);
103+ bool simplify = prefs->getInt("/tools/freehand/pencil/simplify", 0);
104+ if(simplify){
105+ tolerance_sq = 0;
106+ }
107 g_assert(is_zero(this->req_tangent) || is_unit_vector(this->req_tangent));
108
109 this->green_curve->reset();
110@@ -703,8 +706,11 @@
111
112 Inkscape::Preferences *prefs = Inkscape::Preferences::get();
113 double const tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0) * 0.4;
114- double const tolerance_sq = 0.02 * square(this->desktop->w2d().descrim() * tol) * exp(0.2 * tol - 2);
115-
116+ double tolerance_sq = 0.02 * square(this->desktop->w2d().descrim() * tol) * exp(0.2 * tol - 2);
117+ bool simplify = prefs->getInt("/tools/freehand/pencil/simplify", 0);
118+ if(simplify){
119+ tolerance_sq = 0;
120+ }
121 bool average_all_sketches = prefs->getBool("/tools/freehand/pencil/average_all_sketches", true);
122
123 g_assert(is_zero(this->req_tangent) || is_unit_vector(this->req_tangent));
124
125=== modified file 'src/widgets/pencil-toolbar.cpp'
126--- src/widgets/pencil-toolbar.cpp 2014-10-06 00:18:46 +0000
127+++ src/widgets/pencil-toolbar.cpp 2015-07-25 19:13:01 +0000
128@@ -28,6 +28,7 @@
129 # include "config.h"
130 #endif
131
132+#include <gtkmm.h>
133 #include <glibmm/i18n.h>
134
135 #include "pencil-toolbar.h"
136@@ -43,6 +44,12 @@
137 #include "ui/tools/pen-tool.h"
138 #include "ui/uxmanager.h"
139 #include "widgets/spinbutton-events.h"
140+#include <selection.h>
141+#include "live_effects/lpe-simplify.h"
142+#include "live_effects/effect-enum.h"
143+#include "live_effects/lpeobject.h"
144+#include "sp-lpe-item.h"
145+#include "util/glib-list-iterators.h"
146
147 using Inkscape::UI::UXManager;
148 using Inkscape::DocumentUndo;
149@@ -151,6 +158,12 @@
150 prefs->setInt(freehand_tool_name(dataKludge) + "/shape", shape);
151 }
152
153+static void freehand_simplify_lpe(InkToggleAction* itact, GObject *dataKludge) {
154+ gint simplify = gtk_toggle_action_get_active( GTK_TOGGLE_ACTION(itact) );
155+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
156+ prefs->setInt(freehand_tool_name(dataKludge) + "/simplify", simplify);
157+}
158+
159 /**
160 * Generate the list of freehand advanced shape option entries.
161 */
162@@ -232,6 +245,24 @@
163 prefs->setDouble("/tools/freehand/pencil/tolerance",
164 gtk_adjustment_get_value(adj));
165 g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) );
166+ SPDesktop *desktop = static_cast<SPDesktop *>(g_object_get_data(tbl, "desktop"));
167+ std::vector<SPItem *> selected = desktop->getSelection()->itemList();
168+ for (std::vector<SPItem *>::iterator it(selected.begin()); it != selected.end(); ++it){
169+ SPLPEItem* lpeitem = dynamic_cast<SPLPEItem*>(*it);
170+ if (lpeitem && lpeitem->hasPathEffect()){
171+ Inkscape::LivePathEffect::Effect* thisEffect = lpeitem->getPathEffectOfType(Inkscape::LivePathEffect::SIMPLIFY);
172+ if(thisEffect){
173+ Inkscape::LivePathEffect::LPESimplify *lpe = dynamic_cast<Inkscape::LivePathEffect::LPESimplify*>(thisEffect->getLPEObj()->get_lpe());
174+ if (lpe) {
175+ double tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0);
176+ tol = tol/(100.0*(101.0-tol));
177+ std::ostringstream ss;
178+ ss << tol;
179+ lpe->getRepr()->setAttribute("threshold", ss.str());
180+ }
181+ }
182+ }
183+ }
184 }
185
186 /*
187@@ -303,6 +334,18 @@
188 g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_pencil_tb_defaults), holder );
189 gtk_action_group_add_action( mainActions, GTK_ACTION(inky) );
190 }
191+ /* LPE simplify based tolerance */
192+ {
193+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
194+ InkToggleAction* itact = ink_toggle_action_new( "PencilLpeSimplify",
195+ _("LPE based interactive simplify"),
196+ _("LPE based interactive simplify"),
197+ INKSCAPE_ICON("interactive_simplify"),
198+ Inkscape::ICON_SIZE_SMALL_TOOLBAR );
199+ gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(itact), prefs->getInt("/tools/freehand/pencil/simplify", 0) );
200+ g_signal_connect_after( G_OBJECT(itact), "toggled", G_CALLBACK(freehand_simplify_lpe), holder) ;
201+ gtk_action_group_add_action( mainActions, GTK_ACTION(itact) );
202+ }
203
204 g_signal_connect( holder, "destroy", G_CALLBACK(purge_repr_listener), holder );
205
206
207=== modified file 'src/widgets/toolbox.cpp'
208--- src/widgets/toolbox.cpp 2015-04-27 23:38:31 +0000
209+++ src/widgets/toolbox.cpp 2015-07-25 19:13:01 +0000
210@@ -398,6 +398,7 @@
211 " <toolitem action='FreehandModeActionPencil' />"
212 " <separator />"
213 " <toolitem action='PencilToleranceAction' />"
214+ " <toolitem action='PencilLpeSimplify' />"
215 " <separator />"
216 " <toolitem action='PencilResetAction' />"
217 " <separator />"