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

Proposed by Jabiertxof
Status: Merged
Approved by: Jabiertxof
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 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.
Revision history for this message
Jabiertxof (jabiertxof) wrote :
13977. By Jabiertxof <email address hidden>

fixing icons and update to trunk

13978. By Jabiertxof <email address hidden>

fix to fit the new parameters of simplify lpe

13979. By Jabiertxof <email address hidden>

update to trunk

13980. By Jabiertxof <email address hidden>

Fix new added simplify parameter

13981. By Jabiertxof <email address hidden>

update to trunk

13982. By Jabiertxof <email address hidden>

Update to new simplify

13983. By Jabiertxof <email address hidden>

update to trunk

13984. By Jabiertxof <email address hidden>

update to trunk

13985. By Jabiertxof <email address hidden>

astyle simplify LPE

13986. By Jabiertxof <email address hidden>

Coding style fixes

13987. By Jabiertxof <email address hidden>

fix a bug in refactor

13988. By Jabiertxof <email address hidden>

update to trunk

13989. By Jabiertxof <email address hidden>

change from list to vector

13990. By Jabiertxof <email address hidden>

updated icons

13991. By Jabiertxof <email address hidden>

fix icons

Revision history for this message
njh (njh-njhurst) :
13992. By Jabiertxof <email address hidden>

Removes extra unnecesary code pointed by Nathan Hurst

13993. By Jabiertxof <email address hidden>

update to trunk

Revision history for this message
Jabiertxof (jabiertxof) wrote :

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

Revision history for this message
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
=== modified file 'share/icons/icons.svg'
--- share/icons/icons.svg 2015-07-05 10:49:45 +0000
+++ share/icons/icons.svg 2015-07-25 19:13:01 +0000
@@ -3954,4 +3954,8 @@
3954<path style="fill:none;stroke:#c8c8c8;stroke-width:1px;stroke-linecap:square" d="m 12.5,14.5 0,-9" id="path5602-7" />3954<path style="fill:none;stroke:#c8c8c8;stroke-width:1px;stroke-linecap:square" d="m 12.5,14.5 0,-9" id="path5602-7" />
3955<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" />3955<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" />
3956</g>3956</g>
3957<g inkscape:label="#interactive_simplify" id="interactive_simplify-8" transform="translate(2.8103663,-3.4622352)">
3958<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"/>
3959<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"/>
3960</g>
3957</svg>3961</svg>
39583962
=== modified file 'share/icons/symbolic_icons.svg'
--- share/icons/symbolic_icons.svg 2015-04-20 23:11:13 +0000
+++ share/icons/symbolic_icons.svg 2015-07-25 19:13:01 +0000
@@ -3464,6 +3464,10 @@
3464<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" />3464<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" />
3465<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" />3465<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" />
3466</g>3466</g>
3467<g inkscape:label="#interactive_simplify" id="interactive_simplify-8" transform="translate(2.8103663,-3.4622352)">
3468<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"/>
3469<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"/>
3470</g>
3467<g id="stock_icons">3471<g id="stock_icons">
3468<g transform="translate(-270,23)" id="object-rotate-90-CW">3472<g transform="translate(-270,23)" id="object-rotate-90-CW">
3469<g transform="translate(223.9998,725.3622)" id="g15895" inkscape:label="stock-rotate-270">3473<g transform="translate(223.9998,725.3622)" id="g15895" inkscape:label="stock-rotate-270">
34703474
=== modified file 'share/icons/tango_icons.svg'
--- share/icons/tango_icons.svg 2015-03-08 16:44:59 +0000
+++ share/icons/tango_icons.svg 2015-07-25 19:13:01 +0000
@@ -5277,6 +5277,10 @@
5277<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)" />5277<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)" />
5278<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" />5278<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" />
5279</g>5279</g>
5280<g inkscape:label="#interactive_simplify" id="interactive_simplify-8" transform="translate(2.8103663,-3.4622352)">
5281<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"/>
5282<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"/>
5283</g>
5280<g style="display:inline" transform="translate(13.51115,137.9503)" id="off">5284<g style="display:inline" transform="translate(13.51115,137.9503)" id="off">
5281<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" />5285<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" />
5282<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" />5286<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" />
52835287
=== modified file 'src/ui/tools/freehand-base.cpp'
--- src/ui/tools/freehand-base.cpp 2015-07-22 20:25:18 +0000
+++ src/ui/tools/freehand-base.cpp 2015-07-25 19:13:01 +0000
@@ -21,6 +21,7 @@
21#endif21#endif
2222
23#include "live_effects/lpe-patternalongpath.h"23#include "live_effects/lpe-patternalongpath.h"
24#include "live_effects/lpe-simplify.h"
24#include "display/canvas-bpath.h"25#include "display/canvas-bpath.h"
25#include "xml/repr.h"26#include "xml/repr.h"
26#include "svg/svg.h"27#include "svg/svg.h"
@@ -266,6 +267,21 @@
266 lpe->getRepr()->setAttribute("offset_points", s.str().c_str());267 lpe->getRepr()->setAttribute("offset_points", s.str().c_str());
267}268}
268269
270static void spdc_apply_simplify(std::string threshold, FreehandBase *dc, SPItem *item)
271{
272 using namespace Inkscape::LivePathEffect;
273
274 Effect::createAndApply(SIMPLIFY, dc->desktop->doc(), item);
275 Effect* lpe = SP_LPE_ITEM(item)->getCurrentLPE();
276 // write powerstroke parameters:
277 lpe->getRepr()->setAttribute("steps", "1");
278 lpe->getRepr()->setAttribute("threshold", threshold);
279 lpe->getRepr()->setAttribute("smooth_angles", "360");
280 lpe->getRepr()->setAttribute("helper_size", "0");
281 lpe->getRepr()->setAttribute("simplifyindividualpaths", "false");
282 lpe->getRepr()->setAttribute("simplifyJustCoalesce", "false");
283}
284
269static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item, SPCurve *curve)285static void spdc_check_for_and_apply_waiting_LPE(FreehandBase *dc, SPItem *item, SPCurve *curve)
270{286{
271 using namespace Inkscape::LivePathEffect;287 using namespace Inkscape::LivePathEffect;
@@ -287,6 +303,14 @@
287303
288304
289 shapeType shape = (shapeType)prefs->getInt(tool_name(dc) + "/shape", 0);305 shapeType shape = (shapeType)prefs->getInt(tool_name(dc) + "/shape", 0);
306 bool simplify = prefs->getInt(tool_name(dc) + "/simplify", 0);
307 if(simplify){
308 double tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0);
309 tol = tol/(100.0*(101.0-tol));
310 std::ostringstream ss;
311 ss << tol;
312 spdc_apply_simplify(ss.str(), dc, item);
313 }
290 bool shape_applied = false;314 bool shape_applied = false;
291 SPCSSAttr *css_item = sp_css_attr_from_object(item, SP_STYLE_FLAG_ALWAYS);315 SPCSSAttr *css_item = sp_css_attr_from_object(item, SP_STYLE_FLAG_ALWAYS);
292 const char *cstroke = sp_repr_css_property(css_item, "stroke", "none");316 const char *cstroke = sp_repr_css_property(css_item, "stroke", "none");
293317
=== modified file 'src/ui/tools/pencil-tool.cpp'
--- src/ui/tools/pencil-tool.cpp 2015-05-29 19:37:41 +0000
+++ src/ui/tools/pencil-tool.cpp 2015-07-25 19:13:01 +0000
@@ -635,8 +635,11 @@
635635
636 Inkscape::Preferences *prefs = Inkscape::Preferences::get();636 Inkscape::Preferences *prefs = Inkscape::Preferences::get();
637 double const tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0) * 0.4;637 double const tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0) * 0.4;
638 double const tolerance_sq = 0.02 * square(this->desktop->w2d().descrim() * tol) * exp(0.2 * tol - 2);638 double tolerance_sq = 0.02 * square(this->desktop->w2d().descrim() * tol) * exp(0.2 * tol - 2);
639639 bool simplify = prefs->getInt("/tools/freehand/pencil/simplify", 0);
640 if(simplify){
641 tolerance_sq = 0;
642 }
640 g_assert(is_zero(this->req_tangent) || is_unit_vector(this->req_tangent));643 g_assert(is_zero(this->req_tangent) || is_unit_vector(this->req_tangent));
641644
642 this->green_curve->reset();645 this->green_curve->reset();
@@ -703,8 +706,11 @@
703706
704 Inkscape::Preferences *prefs = Inkscape::Preferences::get();707 Inkscape::Preferences *prefs = Inkscape::Preferences::get();
705 double const tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0) * 0.4;708 double const tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0) * 0.4;
706 double const tolerance_sq = 0.02 * square(this->desktop->w2d().descrim() * tol) * exp(0.2 * tol - 2);709 double tolerance_sq = 0.02 * square(this->desktop->w2d().descrim() * tol) * exp(0.2 * tol - 2);
707710 bool simplify = prefs->getInt("/tools/freehand/pencil/simplify", 0);
711 if(simplify){
712 tolerance_sq = 0;
713 }
708 bool average_all_sketches = prefs->getBool("/tools/freehand/pencil/average_all_sketches", true);714 bool average_all_sketches = prefs->getBool("/tools/freehand/pencil/average_all_sketches", true);
709715
710 g_assert(is_zero(this->req_tangent) || is_unit_vector(this->req_tangent));716 g_assert(is_zero(this->req_tangent) || is_unit_vector(this->req_tangent));
711717
=== modified file 'src/widgets/pencil-toolbar.cpp'
--- src/widgets/pencil-toolbar.cpp 2014-10-06 00:18:46 +0000
+++ src/widgets/pencil-toolbar.cpp 2015-07-25 19:13:01 +0000
@@ -28,6 +28,7 @@
28# include "config.h"28# include "config.h"
29#endif29#endif
3030
31#include <gtkmm.h>
31#include <glibmm/i18n.h>32#include <glibmm/i18n.h>
3233
33#include "pencil-toolbar.h"34#include "pencil-toolbar.h"
@@ -43,6 +44,12 @@
43#include "ui/tools/pen-tool.h"44#include "ui/tools/pen-tool.h"
44#include "ui/uxmanager.h"45#include "ui/uxmanager.h"
45#include "widgets/spinbutton-events.h"46#include "widgets/spinbutton-events.h"
47#include <selection.h>
48#include "live_effects/lpe-simplify.h"
49#include "live_effects/effect-enum.h"
50#include "live_effects/lpeobject.h"
51#include "sp-lpe-item.h"
52#include "util/glib-list-iterators.h"
4653
47using Inkscape::UI::UXManager;54using Inkscape::UI::UXManager;
48using Inkscape::DocumentUndo;55using Inkscape::DocumentUndo;
@@ -151,6 +158,12 @@
151 prefs->setInt(freehand_tool_name(dataKludge) + "/shape", shape);158 prefs->setInt(freehand_tool_name(dataKludge) + "/shape", shape);
152}159}
153160
161static void freehand_simplify_lpe(InkToggleAction* itact, GObject *dataKludge) {
162 gint simplify = gtk_toggle_action_get_active( GTK_TOGGLE_ACTION(itact) );
163 Inkscape::Preferences *prefs = Inkscape::Preferences::get();
164 prefs->setInt(freehand_tool_name(dataKludge) + "/simplify", simplify);
165}
166
154/**167/**
155 * Generate the list of freehand advanced shape option entries.168 * Generate the list of freehand advanced shape option entries.
156 */169 */
@@ -232,6 +245,24 @@
232 prefs->setDouble("/tools/freehand/pencil/tolerance",245 prefs->setDouble("/tools/freehand/pencil/tolerance",
233 gtk_adjustment_get_value(adj));246 gtk_adjustment_get_value(adj));
234 g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) );247 g_object_set_data( tbl, "freeze", GINT_TO_POINTER(FALSE) );
248 SPDesktop *desktop = static_cast<SPDesktop *>(g_object_get_data(tbl, "desktop"));
249 std::vector<SPItem *> selected = desktop->getSelection()->itemList();
250 for (std::vector<SPItem *>::iterator it(selected.begin()); it != selected.end(); ++it){
251 SPLPEItem* lpeitem = dynamic_cast<SPLPEItem*>(*it);
252 if (lpeitem && lpeitem->hasPathEffect()){
253 Inkscape::LivePathEffect::Effect* thisEffect = lpeitem->getPathEffectOfType(Inkscape::LivePathEffect::SIMPLIFY);
254 if(thisEffect){
255 Inkscape::LivePathEffect::LPESimplify *lpe = dynamic_cast<Inkscape::LivePathEffect::LPESimplify*>(thisEffect->getLPEObj()->get_lpe());
256 if (lpe) {
257 double tol = prefs->getDoubleLimited("/tools/freehand/pencil/tolerance", 10.0, 1.0, 100.0);
258 tol = tol/(100.0*(101.0-tol));
259 std::ostringstream ss;
260 ss << tol;
261 lpe->getRepr()->setAttribute("threshold", ss.str());
262 }
263 }
264 }
265 }
235}266}
236267
237/*268/*
@@ -303,6 +334,18 @@
303 g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_pencil_tb_defaults), holder );334 g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_pencil_tb_defaults), holder );
304 gtk_action_group_add_action( mainActions, GTK_ACTION(inky) );335 gtk_action_group_add_action( mainActions, GTK_ACTION(inky) );
305 }336 }
337 /* LPE simplify based tolerance */
338 {
339 Inkscape::Preferences *prefs = Inkscape::Preferences::get();
340 InkToggleAction* itact = ink_toggle_action_new( "PencilLpeSimplify",
341 _("LPE based interactive simplify"),
342 _("LPE based interactive simplify"),
343 INKSCAPE_ICON("interactive_simplify"),
344 Inkscape::ICON_SIZE_SMALL_TOOLBAR );
345 gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(itact), prefs->getInt("/tools/freehand/pencil/simplify", 0) );
346 g_signal_connect_after( G_OBJECT(itact), "toggled", G_CALLBACK(freehand_simplify_lpe), holder) ;
347 gtk_action_group_add_action( mainActions, GTK_ACTION(itact) );
348 }
306349
307 g_signal_connect( holder, "destroy", G_CALLBACK(purge_repr_listener), holder );350 g_signal_connect( holder, "destroy", G_CALLBACK(purge_repr_listener), holder );
308351
309352
=== modified file 'src/widgets/toolbox.cpp'
--- src/widgets/toolbox.cpp 2015-04-27 23:38:31 +0000
+++ src/widgets/toolbox.cpp 2015-07-25 19:13:01 +0000
@@ -398,6 +398,7 @@
398 " <toolitem action='FreehandModeActionPencil' />"398 " <toolitem action='FreehandModeActionPencil' />"
399 " <separator />"399 " <separator />"
400 " <toolitem action='PencilToleranceAction' />"400 " <toolitem action='PencilToleranceAction' />"
401 " <toolitem action='PencilLpeSimplify' />"
401 " <separator />"402 " <separator />"
402 " <toolitem action='PencilResetAction' />"403 " <toolitem action='PencilResetAction' />"
403 " <separator />"404 " <separator />"