diff options
| author | Diederik van Lierop <mail@diedenrezi.nl> | 2009-01-28 21:19:16 +0000 |
|---|---|---|
| committer | dvlierop2 <dvlierop2@users.sourceforge.net> | 2009-01-28 21:19:16 +0000 |
| commit | 12f5c40db64ee3500c72bc94688c802b1cedac79 (patch) | |
| tree | 69c2f3d3fca29a258162f0f85a36f670f07df145 | |
| parent | show waiting cursor while ExecutionEnv is working (diff) | |
| download | inkscape-12f5c40db64ee3500c72bc94688c802b1cedac79.tar.gz inkscape-12f5c40db64ee3500c72bc94688c802b1cedac79.zip | |
Add buttons for snapping to grids and/or guides
(bzr r7200)
| -rw-r--r-- | share/icons/icons.svg | 13 | ||||
| -rw-r--r-- | share/icons/tango_icons.svg | 34 | ||||
| -rw-r--r-- | src/attributes-test.h | 6 | ||||
| -rw-r--r-- | src/attributes.cpp | 6 | ||||
| -rw-r--r-- | src/attributes.h | 6 | ||||
| -rw-r--r-- | src/display/canvas-axonomgrid.cpp | 4 | ||||
| -rw-r--r-- | src/display/canvas-axonomgrid.h | 1 | ||||
| -rw-r--r-- | src/display/canvas-grid.cpp | 2 | ||||
| -rw-r--r-- | src/guide-snapper.cpp | 2 | ||||
| -rw-r--r-- | src/snap-preferences.cpp | 3 | ||||
| -rw-r--r-- | src/snap-preferences.h | 8 | ||||
| -rw-r--r-- | src/snap.cpp | 2 | ||||
| -rw-r--r-- | src/snapper.h | 3 | ||||
| -rw-r--r-- | src/sp-namedview.cpp | 22 | ||||
| -rw-r--r-- | src/ui/dialog/document-properties.cpp | 2 | ||||
| -rw-r--r-- | src/widgets/toolbox.cpp | 56 |
16 files changed, 139 insertions, 31 deletions
diff --git a/share/icons/icons.svg b/share/icons/icons.svg index 10b3a6d05..ec05ea392 100644 --- a/share/icons/icons.svg +++ b/share/icons/icons.svg @@ -1,5 +1,5 @@ <?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:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" inkscape:version="0.46+devel r20521 custom" sodipodi:docname="icons.svg" height="1000.0000pt" width="1000.0000pt" sodipodi:version="0.32" id="svg1" inkscape:output_extension="org.inkscape.output.svg.inkscape"> +<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:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" inkscape:version="0.46+devel r20595 custom" sodipodi:docname="icons.svg" height="1000.0000pt" width="1000.0000pt" sodipodi:version="0.32" id="svg1" inkscape:output_extension="org.inkscape.output.svg.inkscape"> <defs id="defs3"> <inkscape:perspective sodipodi:type="inkscape:persp3d" inkscape:vp_x="0 : 625 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_z="1250 : 625 : 1" inkscape:persp3d-origin="625 : 416.6667 : 1" id="perspective8072" /> <linearGradient inkscape:collect="always" id="linearGradient7836"> @@ -710,8 +710,10 @@ <inkscape:perspective id="perspective8636" inkscape:persp3d-origin="0.5 : 0.3333333 : 1" inkscape:vp_z="1 : 0.5 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_x="0 : 0.5 : 1" sodipodi:type="inkscape:persp3d" /> <inkscape:perspective id="perspective9457" inkscape:persp3d-origin="0.5 : 0.3333333 : 1" inkscape:vp_z="1 : 0.5 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_x="0 : 0.5 : 1" sodipodi:type="inkscape:persp3d" /> <inkscape:perspective id="perspective9457-2" inkscape:persp3d-origin="0.5 : 0.3333333 : 1" inkscape:vp_z="1 : 0.5 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_x="0 : 0.5 : 1" sodipodi:type="inkscape:persp3d" /> +<inkscape:perspective id="perspective8531" inkscape:persp3d-origin="0.5 : 0.3333333 : 1" inkscape:vp_z="1 : 0.5 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_x="0 : 0.5 : 1" sodipodi:type="inkscape:persp3d" /> +<inkscape:perspective id="perspective8531-4" inkscape:persp3d-origin="0.5 : 0.3333333 : 1" inkscape:vp_z="1 : 0.5 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_x="0 : 0.5 : 1" sodipodi:type="inkscape:persp3d" /> </defs> -<sodipodi:namedview inkscape:guide-bbox="true" inkscape:current-layer="toggle_snap_to_bbox_midpoints-3" inkscape:grid-bbox="true" inkscape:pageopacity="1.0000000" pagecolor="#e8e8e4" snaptoguides="true" showguides="true" inkscape:window-y="24" inkscape:window-x="0" inkscape:window-height="1129" inkscape:window-width="1920" inkscape:cy="1204.346" inkscape:cx="805.2226" inkscape:zoom="5.492948" gridtolerance="6" snaptogrid="false" showgrid="false" id="base" inkscape:document-units="px" inkscape:grid-points="true" guidetolerance="8" fill="#8ab3de" stroke="#646464" inkscape:object-nodes="false" objecttolerance="11" inkscape:snap-bbox="true" inkscape:snap-nodes="false" inkscape:bbox-nodes="false" inkscape:bbox-paths="false" inkscape:snap-global="true" inkscape:snap-center="true" inkscape:snap-midpoints="false" inkscape:snap-intersection-paths="true" inkscape:object-paths="true" inkscape:snap-object-midpoints="false"> +<sodipodi:namedview inkscape:guide-bbox="true" inkscape:current-layer="svg1" inkscape:grid-bbox="true" inkscape:pageopacity="1.0000000" pagecolor="#e8e8e4" snaptoguides="true" showguides="true" inkscape:window-y="24" inkscape:window-x="0" inkscape:window-height="1129" inkscape:window-width="1920" inkscape:cy="824.2503" inkscape:cx="519.9243" inkscape:zoom="0.9710252" gridtolerance="6" snaptogrid="false" showgrid="false" id="base" inkscape:document-units="px" inkscape:grid-points="true" guidetolerance="8" fill="#8ab3de" stroke="#646464" inkscape:object-nodes="false" objecttolerance="11" inkscape:snap-bbox="true" inkscape:snap-nodes="false" inkscape:bbox-nodes="false" inkscape:bbox-paths="false" inkscape:snap-global="true" inkscape:snap-center="true" inkscape:snap-midpoints="false" inkscape:snap-intersection-paths="true" inkscape:object-paths="true" inkscape:snap-object-midpoints="false"> <inkscape:grid type="xygrid" id="grid9252" originx="0px" originy="0px" spacingx="0.5px" spacingy="0.5px" empspacing="2" visible="true" enabled="true" /> <sodipodi:guide orientation="0,1" position="630.08101,968.02815" id="guide4946" /> <sodipodi:guide orientation="0,1" position="618.47896,943.93157" id="guide4948" /> @@ -734,7 +736,7 @@ http://www.inkscape.org/</dc:description> <dc:title>Inkscape Developers</dc:title> </cc:Agent> </dc:rights> -<dc:title></dc:title> +<dc:title /> </cc:Work> <cc:License rdf:about="http://creativecommons.org/licenses/GPL/2.0/"> <cc:permits rdf:resource="http://web.resource.org/cc/Reproduction" /> @@ -3314,4 +3316,9 @@ http://www.inkscape.org/</dc:description> <path id="path9141-9-2-5-3" d="m 705.5,29.99943 0,13 -13,0" style="color:#000000;fill:none;stroke:#000000;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:1, 2;stroke-dashoffset:2.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> <path sodipodi:type="arc" style="color:#000000;fill:#6464ff;fill-opacity:0.3921569;fill-rule:evenodd;stroke:#008000;stroke-width:1.1428572;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" id="path6530-4" sodipodi:cx="753.5" sodipodi:cy="33" sodipodi:rx="2" sodipodi:ry="2" d="m 755.5,33 a 2,2 0 1 1 -4,0 2,2 0 1 1 4,0 z" transform="matrix(0.8749999,0,0,0.875,46.21002,5.147436)" /> </g> +<g id="guide" transform="translate(-24,0)" inkscape:label="#guide"> +<path sodipodi:nodetypes="cc" id="path5235-0" d="m 305.5,421.5 0,15" style="fill:none;stroke:#0000ff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> +<path style="fill:none;stroke:#0000ff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" d="m 315.5,421.5 -5.0974,15" id="use5244-0" sodipodi:nodetypes="cc" /> +<use style="stroke-linecap:round" height="1250" width="1250" transform="translate(12,0)" id="use5246-9" xlink:href="#path5235-0" y="0" x="0" /> +</g> </svg> diff --git a/share/icons/tango_icons.svg b/share/icons/tango_icons.svg index cc8827d75..11dc11e7c 100644 --- a/share/icons/tango_icons.svg +++ b/share/icons/tango_icons.svg @@ -1,5 +1,5 @@ <?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:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" inkscape:version="0.46+devel r20535 custom" sodipodi:docname="tango_icons.svg" height="2000" width="2000" sodipodi:version="0.32" id="svg1" inkscape:output_extension="org.inkscape.output.svg.inkscape" version="1.0" style="display:inline"> +<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:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" inkscape:version="0.46+devel r20595 custom" sodipodi:docname="tango_icons.svg" height="2000" width="2000" sodipodi:version="0.32" id="svg1" inkscape:output_extension="org.inkscape.output.svg.inkscape" version="1.0" style="display:inline"> <defs id="defs3"> <inkscape:perspective sodipodi:type="inkscape:persp3d" inkscape:vp_x="0 : 1000 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_z="2000 : 1000 : 1" inkscape:persp3d-origin="1000 : 666.6667 : 1" id="perspective15495" /> <linearGradient id="linearGradient14411"> @@ -2432,8 +2432,21 @@ <stop id="stop19969-6" offset="0" style="stop-color:#73d216" /> <stop id="stop19971-80" offset="1.0000000" style="stop-color:#4e9a06;stop-opacity:1" /> </linearGradient> +<inkscape:perspective id="perspective15703" inkscape:persp3d-origin="0.5 : 0.3333333 : 1" inkscape:vp_z="1 : 0.5 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_x="0 : 0.5 : 1" sodipodi:type="inkscape:persp3d" /> +<inkscape:perspective id="perspective15734" inkscape:persp3d-origin="0.5 : 0.3333333 : 1" inkscape:vp_z="1 : 0.5 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_x="0 : 0.5 : 1" sodipodi:type="inkscape:persp3d" /> +<linearGradient inkscape:collect="always" xlink:href="#linearGradient11207-6" id="linearGradient16121-2" gradientUnits="userSpaceOnUse" gradientTransform="translate(0,-1)" x1="1469" y1="34.49997" x2="1482" y2="34.49997" /> +<linearGradient id="linearGradient11207-6"> +<stop style="stop-color:#d3d7cf;stop-opacity:1;" offset="0" id="stop11209-5" /> +<stop style="stop-color:#d3d7cf;stop-opacity:1;" offset="1" id="stop11211-8" /> +</linearGradient> +<linearGradient inkscape:collect="always" xlink:href="#linearGradient11215-9" id="linearGradient16123-7" gradientUnits="userSpaceOnUse" gradientTransform="translate(0,-1)" x1="1469" y1="34.49997" x2="1482" y2="34.49997" /> +<linearGradient id="linearGradient11215-9"> +<stop style="stop-color:#888a85;stop-opacity:1;" offset="0" id="stop11217-6" /> +<stop style="stop-color:#888a85;stop-opacity:1;" offset="1" id="stop11219-0" /> +</linearGradient> +<inkscape:perspective id="perspective15789" inkscape:persp3d-origin="0.5 : 0.3333333 : 1" inkscape:vp_z="1 : 0.5 : 1" inkscape:vp_y="0 : 1000 : 0" inkscape:vp_x="0 : 0.5 : 1" sodipodi:type="inkscape:persp3d" /> </defs> -<sodipodi:namedview inkscape:guide-bbox="true" inkscape:current-layer="layer2" inkscape:grid-bbox="true" inkscape:pageopacity="1" pagecolor="#f8f5f2" snaptoguides="true" showguides="true" inkscape:window-y="24" inkscape:window-x="0" inkscape:window-height="1129" inkscape:window-width="1920" inkscape:cy="1870.363" inkscape:cx="1474.951" inkscape:zoom="2.828427" gridtolerance="10000" snaptogrid="false" showgrid="true" id="base" inkscape:document-units="px" inkscape:grid-points="true" guidetolerance="19" fill="#8ab3de" stroke="#646464" inkscape:object-nodes="false" objecttolerance="10" inkscape:snap-bbox="true" inkscape:snap-nodes="true" showborder="false" inkscape:showpageshadow="false" inkscape:snap-center="true" inkscape:snap-intersection-grid-guide="false" inkscape:snap-guide="false" inkscape:bbox-paths="true" inkscape:bbox-nodes="true" inkscape:snap-global="true"> +<sodipodi:namedview inkscape:guide-bbox="true" inkscape:current-layer="layer5" inkscape:grid-bbox="true" inkscape:pageopacity="1" pagecolor="#f8f5f2" snaptoguides="true" showguides="true" inkscape:window-y="24" inkscape:window-x="0" inkscape:window-height="1129" inkscape:window-width="1920" inkscape:cy="1819.275" inkscape:cx="983.5815" inkscape:zoom="22.62742" gridtolerance="10000" snaptogrid="false" showgrid="false" id="base" inkscape:document-units="px" inkscape:grid-points="true" guidetolerance="19" fill="#8ab3de" stroke="#646464" inkscape:object-nodes="false" objecttolerance="10" inkscape:snap-bbox="true" inkscape:snap-nodes="true" showborder="false" inkscape:showpageshadow="false" inkscape:snap-center="false" inkscape:snap-intersection-grid-guide="false" inkscape:snap-guide="false" inkscape:bbox-paths="true" inkscape:bbox-nodes="true" inkscape:snap-global="true" inkscape:object-paths="true"> <inkscape:grid type="xygrid" id="grid12302" empspacing="24" dotted="false" color="#009bcc" opacity="0.1254902" empcolor="#0019cc" empopacity="0.25098039" spacingx="0px" spacingy="0px" originx="0px" originy="0px" visible="true" enabled="true" /> <inkscape:grid id="GridFromPre046Settings" type="xygrid" originx="0px" originy="0.0000000px" spacingx="0.5px" spacingy="0.5px" color="#0000ff" empcolor="#0000ff" opacity="0.2" empopacity="0.4" empspacing="2" visible="true" enabled="true" /> </sodipodi:namedview> @@ -2455,7 +2468,7 @@ http://www.inkscape.org/</dc:description> <dc:title>Inkscape Developers</dc:title> </cc:Agent> </dc:rights> -<dc:title>Icon Sheet</dc:title> +<dc:title></dc:title> <dc:contributor> <cc:Agent> <dc:title>jEsuSdA 8) www.jesusda.com</dc:title> @@ -2722,6 +2735,19 @@ http://www.inkscape.org/</dc:description> <path sodipodi:nodetypes="cccccccs" id="path15326" d="M 1701.5897,203.79229 C 1699.531,203.53087 1697.8086,201.72661 1697.6494,199.65655 C 1697.4171,197.59382 1698.7683,195.49626 1700.7423,194.85453 C 1702.6929,194.14357 1705.048,194.96538 1706.1374,196.73175 C 1706.8192,197.76054 1706.9722,199.04231 1706.809,200.2446 C 1706.6337,201.44742 1707.1246,202.76916 1708.2074,203.38953 C 1709.5558,204.25428 1711.5364,203.72406 1712.2724,202.30119 C 1713.0858,200.92113 1712.4813,198.96192 1711.0317,198.28002" style="fill:none;stroke:#babdb6;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;marker:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline" /> </g> <text xml:space="preserve" style="font-size:14px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Zekton;-inkscape-font-specification:Zekton Bold" x="569.99994" y="342.00018" id="text16130" sodipodi:linespacing="100%"><tspan sodipodi:role="line" id="tspan16132" x="569.99994" y="342.00018" /></text> +<g id="ink_guide" transform="translate(657,-243)" inkscape:label="#ink_guide"> +<path sodipodi:nodetypes="cc" id="path5235-0" d="m 305.5,421.5 0,15" style="fill:none;stroke:#0000ff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> +<path style="fill:none;stroke:#0000ff;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" d="m 315.5,421.5 -5.0974,15" id="use5244-0" sodipodi:nodetypes="cc" /> +<use style="stroke-linecap:round" height="1250" width="1250" transform="translate(12,0)" id="use5246-9" xlink:href="#path5235-0" y="0" x="0" /> +</g> +<g style="display:inline" transform="translate(679.875,-243)" id="guide" inkscape:label="#guide"> +<path sodipodi:nodetypes="cc" id="path12102-2" d="m 306.25,421.75 0,15" style="fill:#204a87;stroke:#204a87;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> +<path sodipodi:nodetypes="cc" id="path12106-3" d="m 314.25,421.75 -3.8891,15.0442" style="fill:#204a87;stroke:#204a87;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> +<path sodipodi:nodetypes="cc" id="path12108-0" d="m 318.25,421.75 0,15" style="fill:#204a87;stroke:#204a87;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> +<path style="fill:#729fcf;stroke:#729fcf;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" d="m 305.5,421.5 0,15" id="path12074-1" sodipodi:nodetypes="cc" /> +<path style="fill:#729fcf;stroke:#729fcf;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" d="m 313.5,421.5 -3.875,15" id="use12078-4" sodipodi:nodetypes="cc" /> +<path style="fill:#729fcf;stroke:#729fcf;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" d="m 317.5,421.5 0,15" id="use12080-9" sodipodi:nodetypes="cc" /> +</g> </g> <g inkscape:groupmode="layer" id="layer3" inkscape:label="inkscape" style="display:inline"> <g transform="translate(842.60648,136.78099)" id="layer1" /> @@ -5291,7 +5317,7 @@ http://www.inkscape.org/</dc:description> <g transform="translate(675.5,78)" id="ink_toggle_snap_to_bbox_edge_midpoints"> <rect style="color:#000000;fill:none;stroke:none;stroke-width:0.1;marker:none;display:inline" id="rect5385-6-4-0-8-5" width="16" height="16" x="692.5" y="30" /> <path id="path9141-9-2-5-3" d="m 705.5,29.99943 0,13 -13,0" style="color:#000000;fill:none;stroke:#000000;stroke-width:1;stroke-linecap:square;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:1, 2;stroke-dashoffset:2.5;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /> -<path sodipodi:type="arc" style="color:#000000;fill:#6464ff;fill-opacity:0.3921569;fill-rule:evenodd;stroke:#008000;stroke-width:1.1428572;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" id="path6530-4" sodipodi:cx="753.5" sodipodi:cy="33" sodipodi:rx="2" sodipodi:ry="2" d="m 755.5,33 a 2,2 0 1 1 -4,0 2,2 0 1 1 4,0 z" transform="matrix(0.8749999,0,0,0.875,46.21002,5.147436)" /> +<path sodipodi:type="arc" style="color:#000000;fill:#6464ff;fill-opacity:0.3921569;fill-rule:evenodd;stroke:#008000;stroke-width:1.1428572;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" id="path6530-4" sodipodi:cx="753.5" sodipodi:cy="33" sodipodi:rx="2" sodipodi:ry="2" d="m 755.5,33 c 0,1.104 -0.896,2 -2,2 -1.104,0 -2,-0.896 -2,-2 0,-1.104 0.896,-2 2,-2 1.104,0 2,0.896 2,2 z" transform="matrix(0.8749999,0,0,0.875,46.21002,5.147436)" /> </g> </g> <g inkscape:groupmode="layer" id="layer2" inkscape:label="tango" style="display:inline"> diff --git a/src/attributes-test.h b/src/attributes-test.h index 1148953ec..7b021a543 100644 --- a/src/attributes-test.h +++ b/src/attributes-test.h @@ -348,14 +348,16 @@ struct {char const *attr; bool supported;} const all_attrs[] = { {"inkscape:snap-global", true}, {"inkscape:snap-bbox", true}, {"inkscape:snap-nodes", true}, - {"inkscape:snap-guide", true}, + {"inkscape:snap-from-guide", true}, {"inkscape:snap-center", true}, {"inkscape:snap-smooth-nodes", true}, {"inkscape:snap-midpoints", true}, {"inkscape:snap-object-midpoints", true}, {"inkscape:snap-bbox-edge-midpoints", true}, {"inkscape:snap-bbox-midpoints", true}, - {"inkscape:snap-intersection-grid-guide", true}, + //{"inkscape:snap-intersection-grid-guide", true}, + {"inkscape:snap-grids", true}, + {"inkscape:snap-to-guides", true}, {"inkscape:snap-intersection-paths", true}, {"inkscape:pageopacity", true}, {"inkscape:pageshadow", true}, diff --git a/src/attributes.cpp b/src/attributes.cpp index 049632e50..f2fb62a1c 100644 --- a/src/attributes.cpp +++ b/src/attributes.cpp @@ -89,14 +89,16 @@ static SPStyleProp const props[] = { {SP_ATTR_INKSCAPE_SNAP_GLOBAL, "inkscape:snap-global"}, {SP_ATTR_INKSCAPE_SNAP_BBOX, "inkscape:snap-bbox"}, {SP_ATTR_INKSCAPE_SNAP_NODES, "inkscape:snap-nodes"}, - {SP_ATTR_INKSCAPE_SNAP_GUIDE, "inkscape:snap-guide"}, + {SP_ATTR_INKSCAPE_SNAP_FROM_GUIDE, "inkscape:snap-from-guide"}, {SP_ATTR_INKSCAPE_SNAP_CENTER, "inkscape:snap-center"}, + {SP_ATTR_INKSCAPE_SNAP_GRIDS, "inkscape:snap-grids"}, + {SP_ATTR_INKSCAPE_SNAP_TO_GUIDES, "inkscape:snap-to-guides"}, {SP_ATTR_INKSCAPE_SNAP_SMOOTH_NODES, "inkscape:snap-smooth-nodes"}, {SP_ATTR_INKSCAPE_SNAP_LINE_MIDPOINTS, "inkscape:snap-midpoints"}, {SP_ATTR_INKSCAPE_SNAP_OBJECT_MIDPOINTS, "inkscape:snap-object-midpoints"}, {SP_ATTR_INKSCAPE_SNAP_BBOX_EDGE_MIDPOINTS, "inkscape:snap-bbox-edge-midpoints"}, {SP_ATTR_INKSCAPE_SNAP_BBOX_MIDPOINTS, "inkscape:snap-bbox-midpoints"}, - {SP_ATTR_INKSCAPE_SNAP_INTERS_GRIDGUIDE, "inkscape:snap-intersection-grid-guide"}, + //{SP_ATTR_INKSCAPE_SNAP_INTERS_GRIDGUIDE, "inkscape:snap-intersection-grid-guide"}, {SP_ATTR_INKSCAPE_SNAP_INTERS_PATHS, "inkscape:snap-intersection-paths"}, {SP_ATTR_INKSCAPE_OBJECT_PATHS, "inkscape:object-paths"}, {SP_ATTR_INKSCAPE_OBJECT_NODES, "inkscape:object-nodes"}, diff --git a/src/attributes.h b/src/attributes.h index 6fe3ebb80..fc9e49f2b 100644 --- a/src/attributes.h +++ b/src/attributes.h @@ -89,14 +89,16 @@ enum SPAttributeEnum { SP_ATTR_INKSCAPE_SNAP_GLOBAL, SP_ATTR_INKSCAPE_SNAP_BBOX, SP_ATTR_INKSCAPE_SNAP_NODES, - SP_ATTR_INKSCAPE_SNAP_GUIDE, + SP_ATTR_INKSCAPE_SNAP_FROM_GUIDE, SP_ATTR_INKSCAPE_SNAP_CENTER, + SP_ATTR_INKSCAPE_SNAP_GRIDS, + SP_ATTR_INKSCAPE_SNAP_TO_GUIDES, SP_ATTR_INKSCAPE_SNAP_SMOOTH_NODES, SP_ATTR_INKSCAPE_SNAP_LINE_MIDPOINTS, SP_ATTR_INKSCAPE_SNAP_OBJECT_MIDPOINTS, SP_ATTR_INKSCAPE_SNAP_BBOX_EDGE_MIDPOINTS, SP_ATTR_INKSCAPE_SNAP_BBOX_MIDPOINTS, - SP_ATTR_INKSCAPE_SNAP_INTERS_GRIDGUIDE, + //SP_ATTR_INKSCAPE_SNAP_INTERS_GRIDGUIDE, SP_ATTR_INKSCAPE_SNAP_INTERS_PATHS, SP_ATTR_INKSCAPE_OBJECT_PATHS, SP_ATTR_INKSCAPE_OBJECT_NODES, diff --git a/src/display/canvas-axonomgrid.cpp b/src/display/canvas-axonomgrid.cpp index 4b45eae33..283f58a01 100644 --- a/src/display/canvas-axonomgrid.cpp +++ b/src/display/canvas-axonomgrid.cpp @@ -748,6 +748,10 @@ void CanvasAxonomGridSnapper::_addSnappedLine(SnappedConstraints &sc, Geom::Poin sc.grid_lines.push_back(dummy); } +bool CanvasAxonomGridSnapper::ThisSnapperMightSnap() const +{ + return _snap_enabled && _snapmanager->snapprefs.getSnapToGrids() && _snapmanager->snapprefs.getSnapModeBBoxOrNodes(); +} }; // namespace Inkscape diff --git a/src/display/canvas-axonomgrid.h b/src/display/canvas-axonomgrid.h index 0654a9429..9067e2e13 100644 --- a/src/display/canvas-axonomgrid.h +++ b/src/display/canvas-axonomgrid.h @@ -71,6 +71,7 @@ class CanvasAxonomGridSnapper : public LineSnapper { public: CanvasAxonomGridSnapper(CanvasAxonomGrid *grid, SnapManager *sm, Geom::Coord const d); + bool ThisSnapperMightSnap() const; private: LineList _getSnapLines(Geom::Point const &p) const; diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index b03bfca9e..0d5cabd8d 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -999,7 +999,7 @@ void CanvasXYGridSnapper::_addSnappedLine(SnappedConstraints &sc, Geom::Point co */ bool CanvasXYGridSnapper::ThisSnapperMightSnap() const { - return _snapmanager->snapprefs.getSnapModeBBoxOrNodes(); + return _snap_enabled && _snapmanager->snapprefs.getSnapToGrids() && _snapmanager->snapprefs.getSnapModeBBoxOrNodes(); } } // namespace Inkscape diff --git a/src/guide-snapper.cpp b/src/guide-snapper.cpp index b05466ede..54a4086a4 100644 --- a/src/guide-snapper.cpp +++ b/src/guide-snapper.cpp @@ -47,7 +47,7 @@ bool Inkscape::GuideSnapper::ThisSnapperMightSnap() const return false; } - return (_snap_enabled && _snapmanager->snapprefs.getSnapModeBBoxOrNodes() && _snapmanager->getNamedView()->showguides); + return (_snap_enabled && _snapmanager->snapprefs.getSnapToGuides() && _snapmanager->snapprefs.getSnapModeBBoxOrNodes() && _snapmanager->getNamedView()->showguides); } void Inkscape::GuideSnapper::_addSnappedLine(SnappedConstraints &sc, Geom::Point const snapped_point, Geom::Coord const snapped_distance, Geom::Point const normal_to_line, Geom::Point const point_on_line) const diff --git a/src/snap-preferences.cpp b/src/snap-preferences.cpp index d21259983..e8c9e0641 100644 --- a/src/snap-preferences.cpp +++ b/src/snap-preferences.cpp @@ -22,6 +22,9 @@ Inkscape::SnapPreferences::PointType const Inkscape::SnapPreferences::SNAPPOINT_ Inkscape::SnapPreferences::SnapPreferences() : _include_item_center(false), + _intersectionGG(true), + _snap_to_grids(true), + _snap_to_guides(true), _snap_enabled_globally(true), _snap_postponed_globally(false), _snap_to_itemnode(true), _snap_to_itempath(true), diff --git a/src/snap-preferences.h b/src/snap-preferences.h index 97ef3cec2..258b1f5ed 100644 --- a/src/snap-preferences.h +++ b/src/snap-preferences.h @@ -51,6 +51,12 @@ public: bool getSnapBBoxEdgeMidpoints() const {return _bbox_edge_midpoints;} bool getSnapBBoxMidpoints() const {return _bbox_midpoints;} + void setSnapToGrids(bool enabled) {_snap_to_grids = enabled;} + bool getSnapToGrids() const {return _snap_to_grids;} + + void setSnapToGuides(bool enabled) {_snap_to_guides = enabled;} + bool getSnapToGuides() const {return _snap_to_guides;} + void setIncludeItemCenter(bool enabled) {_include_item_center = enabled;} bool getIncludeItemCenter() const {return _include_item_center;} @@ -85,6 +91,8 @@ private: bool _object_midpoints; // the midpoint of shapes (e.g. a circle, rect, polygon) or of any other shape (at [h/2, w/2]) bool _bbox_edge_midpoints; bool _bbox_midpoints; + bool _snap_to_grids; + bool _snap_to_guides; bool _snap_enabled_globally; // Toggles ALL snapping bool _snap_postponed_globally; // Hold all snapping temporarily when the mouse is moving fast PointType _snap_from; ///< bitmap of point types that we will snap from diff --git a/src/snap.cpp b/src/snap.cpp index 04521f07f..548741455 100644 --- a/src/snap.cpp +++ b/src/snap.cpp @@ -77,7 +77,7 @@ SnapManager::getGridSnappers() const SnapperList s; //FIXME: this code should actually do this: add new grid snappers that are active for this desktop. now it just adds all gridsnappers - if (_desktop && _desktop->gridsEnabled()) { + if (_desktop && _desktop->gridsEnabled() && snapprefs.getSnapToGrids()) { for ( GSList const *l = _named_view->grids; l != NULL; l = l->next) { Inkscape::CanvasGrid *grid = (Inkscape::CanvasGrid*) l->data; s.push_back(grid->snapper); diff --git a/src/snapper.h b/src/snapper.h index f6e1a086e..7bea9b423 100644 --- a/src/snapper.h +++ b/src/snapper.h @@ -55,7 +55,7 @@ public: //virtual bool ThisSnapperMightSnap() const; virtual bool ThisSnapperMightSnap() const {return _snap_enabled;} // will likely be overridden by derived classes - void setEnabled(bool s); + void setEnabled(bool s); // This is only used for grids, for which snapping can be enabled individually bool getEnabled() const {return _snap_enabled;} virtual void freeSnap(SnappedConstraints &/*sc*/, @@ -108,6 +108,7 @@ protected: SnapManager *_snapmanager; bool _snap_enabled; ///< true if this snapper is enabled, otherwise false + // This is only used for grids, for which snapping can be enabled individually private: Geom::Coord _snapper_tolerance; ///< snap tolerance in desktop coordinates diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp index 4ff66f6c3..4bde2b191 100644 --- a/src/sp-namedview.cpp +++ b/src/sp-namedview.cpp @@ -245,14 +245,16 @@ static void sp_namedview_build(SPObject *object, SPDocument *document, Inkscape: sp_object_read_attr(object, "inkscape:snap-global"); sp_object_read_attr(object, "inkscape:snap-bbox"); sp_object_read_attr(object, "inkscape:snap-nodes"); - sp_object_read_attr(object, "inkscape:snap-guide"); + sp_object_read_attr(object, "inkscape:snap-from-guide"); sp_object_read_attr(object, "inkscape:snap-center"); sp_object_read_attr(object, "inkscape:snap-smooth-nodes"); sp_object_read_attr(object, "inkscape:snap-midpoints"); sp_object_read_attr(object, "inkscape:snap-object-midpoints"); sp_object_read_attr(object, "inkscape:snap-bbox-edge-midpoints"); sp_object_read_attr(object, "inkscape:snap-bbox-midpoints"); - sp_object_read_attr(object, "inkscape:snap-intersection-grid-guide"); + //sp_object_read_attr(object, "inkscape:snap-intersection-grid-guide"); + sp_object_read_attr(object, "inkscape:snap-to-guides"); + sp_object_read_attr(object, "inkscape:snap-grids"); sp_object_read_attr(object, "inkscape:snap-intersection-paths"); sp_object_read_attr(object, "inkscape:object-paths"); sp_object_read_attr(object, "inkscape:object-nodes"); @@ -470,7 +472,15 @@ static void sp_namedview_set(SPObject *object, unsigned int key, const gchar *va nv->snap_manager.snapprefs.setIncludeItemCenter(value ? sp_str_to_bool(value) : FALSE); object->requestModified(SP_OBJECT_MODIFIED_FLAG); break; - case SP_ATTR_INKSCAPE_SNAP_SMOOTH_NODES: + case SP_ATTR_INKSCAPE_SNAP_GRIDS: + nv->snap_manager.snapprefs.setSnapToGrids(value ? sp_str_to_bool(value) : TRUE); + object->requestModified(SP_OBJECT_MODIFIED_FLAG); + break; + case SP_ATTR_INKSCAPE_SNAP_TO_GUIDES: + nv->snap_manager.snapprefs.setSnapToGuides(value ? sp_str_to_bool(value) : TRUE); + object->requestModified(SP_OBJECT_MODIFIED_FLAG); + break; + case SP_ATTR_INKSCAPE_SNAP_SMOOTH_NODES: nv->snap_manager.snapprefs.setSnapSmoothNodes(value ? sp_str_to_bool(value) : FALSE); object->requestModified(SP_OBJECT_MODIFIED_FLAG); break; @@ -490,14 +500,14 @@ static void sp_namedview_set(SPObject *object, unsigned int key, const gchar *va nv->snap_manager.snapprefs.setSnapBBoxMidpoints(value ? sp_str_to_bool(value) : FALSE); object->requestModified(SP_OBJECT_MODIFIED_FLAG); break; - case SP_ATTR_INKSCAPE_SNAP_GUIDE: + case SP_ATTR_INKSCAPE_SNAP_FROM_GUIDE: nv->snap_manager.snapprefs.setSnapModeGuide(value ? sp_str_to_bool(value) : FALSE); object->requestModified(SP_OBJECT_MODIFIED_FLAG); break; - case SP_ATTR_INKSCAPE_SNAP_INTERS_GRIDGUIDE: + /*case SP_ATTR_INKSCAPE_SNAP_INTERS_GRIDGUIDE: nv->snap_manager.snapprefs.setSnapIntersectionGG(value ? sp_str_to_bool(value) : TRUE); object->requestModified(SP_OBJECT_MODIFIED_FLAG); - break; + break;*/ case SP_ATTR_INKSCAPE_SNAP_INTERS_PATHS: nv->snap_manager.snapprefs.setSnapIntersectionCS(value ? sp_str_to_bool(value) : FALSE); object->requestModified(SP_OBJECT_MODIFIED_FLAG); diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index cbc3d79b9..76a50c9c7 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -101,7 +101,7 @@ DocumentProperties::DocumentProperties() //General snap options _rcb_sgui(_("Show _guides"), _("Show or hide guides"), "showguides", _wr), _rcbsng(_("_Snap guides while dragging"), _("While dragging a guide, snap to object nodes or bounding box corners ('Snap to nodes' or 'snap to bounding box corners' must be enabled in the 'Snap' tab; only a small part of the guide near the cursor will snap)"), - "inkscape:snap-guide", _wr), + "inkscape:snap-from-guide", _wr), _rcp_gui(_("Guide co_lor:"), _("Guideline color"), _("Color of guidelines"), "guidecolor", "guideopacity", _wr), _rcp_hgui(_("_Highlight color:"), _("Highlighted guideline color"), _("Color of a guideline when it is under mouse"), "guidehicolor", "guidehiopacity", _wr), //--------------------------------------------------------------- diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 0acc7731a..a2be7e238 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -1940,14 +1940,22 @@ void toggle_snap_callback (GtkToggleAction *act, gpointer data) { //data points v = nv->snap_manager.snapprefs.getIncludeItemCenter(); sp_repr_set_boolean(repr, "inkscape:snap-center", !v); break; + case SP_ATTR_INKSCAPE_SNAP_GRIDS: + v = nv->snap_manager.snapprefs.getSnapToGrids(); + sp_repr_set_boolean(repr, "inkscape:snap-grids", !v); + break; + case SP_ATTR_INKSCAPE_SNAP_TO_GUIDES: + v = nv->snap_manager.snapprefs.getSnapToGuides(); + sp_repr_set_boolean(repr, "inkscape:snap-to-guides", !v); + break; case SP_ATTR_INKSCAPE_SNAP_PAGE: v = nv->snap_manager.snapprefs.getSnapToPageBorder(); sp_repr_set_boolean(repr, "inkscape:snap-page", !v); break; - case SP_ATTR_INKSCAPE_SNAP_INTERS_GRIDGUIDE: + /*case SP_ATTR_INKSCAPE_SNAP_INTERS_GRIDGUIDE: v = nv->snap_manager.snapprefs.getSnapIntersectionGG(); sp_repr_set_boolean(repr, "inkscape:snap-intersection-grid-guide", !v); - break; + break;*/ case SP_ATTR_INKSCAPE_SNAP_LINE_MIDPOINTS: v = nv->snap_manager.snapprefs.getSnapLineMidpoints(); sp_repr_set_boolean(repr, "inkscape:snap-midpoints", !v); @@ -2000,7 +2008,9 @@ void setup_snap_toolbox(GtkWidget *toolbox, SPDesktop *desktop) " <toolitem action='ToggleSnapToFromCenter' />" " <separator />" " <toolitem action='ToggleSnapToPageBorder' />" - " <toolitem action='ToggleSnapToGridGuideIntersections' />" + " <toolitem action='ToggleSnapToGrids' />" + " <toolitem action='ToggleSnapToGuides' />" + //" <toolitem action='ToggleSnapToGridGuideIntersections' />" " </toolbar>" "</ui>"; @@ -2187,6 +2197,30 @@ void setup_snap_toolbox(GtkWidget *toolbox, SPDesktop *desktop) } { + InkToggleAction* act = ink_toggle_action_new("ToggleSnapToGrids", // "name" + _("Grids"), // "label" + _("Snap to grids"), // "tooltip" + "grid_xy", // "iconId" + secondarySize, + SP_ATTR_INKSCAPE_SNAP_GRIDS); + + gtk_action_group_add_action( mainActions->gobj(), GTK_ACTION( act ) ); + g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(toggle_snap_callback), toolbox ); + } + + { + InkToggleAction* act = ink_toggle_action_new("ToggleSnapToGuides", // "name" + _("Guides"), // "label" + _("Snap to guides"), // "tooltip" + "guide", // "iconId" + secondarySize, + SP_ATTR_INKSCAPE_SNAP_TO_GUIDES); + + gtk_action_group_add_action( mainActions->gobj(), GTK_ACTION( act ) ); + g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(toggle_snap_callback), toolbox ); + } + + /*{ InkToggleAction* act = ink_toggle_action_new("ToggleSnapToGridGuideIntersections", // "name" _("Grid/guide intersections"), // "label" _("Snap to intersections of a grid with a guide"), // "tooltip" @@ -2196,7 +2230,7 @@ void setup_snap_toolbox(GtkWidget *toolbox, SPDesktop *desktop) gtk_action_group_add_action( mainActions->gobj(), GTK_ACTION( act ) ); g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(toggle_snap_callback), toolbox ); - } + }*/ GtkUIManager* mgr = gtk_ui_manager_new(); GError* errVal = 0; @@ -2254,7 +2288,9 @@ void update_snap_toolbox(SPDesktop *desktop, SPEventContext */*eventcontext*/, G Glib::RefPtr<Gtk::Action> act10 = mainActions->get_action("ToggleSnapToFromObjectMidpoints"); Glib::RefPtr<Gtk::Action> act11 = mainActions->get_action("ToggleSnapToFromCenter"); Glib::RefPtr<Gtk::Action> act12 = mainActions->get_action("ToggleSnapToPageBorder"); - Glib::RefPtr<Gtk::Action> act13 = mainActions->get_action("ToggleSnapToGridGuideIntersections"); + //Glib::RefPtr<Gtk::Action> act13 = mainActions->get_action("ToggleSnapToGridGuideIntersections"); + Glib::RefPtr<Gtk::Action> act14 = mainActions->get_action("ToggleSnapToGrids"); + Glib::RefPtr<Gtk::Action> act15 = mainActions->get_action("ToggleSnapToGuides"); if (!act1) { @@ -2304,8 +2340,14 @@ void update_snap_toolbox(SPDesktop *desktop, SPEventContext */*eventcontext*/, G gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(act12->gobj()), nv->snap_manager.snapprefs.getSnapToPageBorder()); gtk_action_set_sensitive(GTK_ACTION(act12->gobj()), c1); - gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(act13->gobj()), nv->snap_manager.snapprefs.getSnapIntersectionGG()); - gtk_action_set_sensitive(GTK_ACTION(act13->gobj()), c1); + //gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(act13->gobj()), nv->snap_manager.snapprefs.getSnapIntersectionGG()); + //gtk_action_set_sensitive(GTK_ACTION(act13->gobj()), c1); + + gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(act14->gobj()), nv->snap_manager.snapprefs.getSnapToGrids()); + gtk_action_set_sensitive(GTK_ACTION(act14->gobj()), c1); + gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(act15->gobj()), nv->snap_manager.snapprefs.getSnapToGuides()); + gtk_action_set_sensitive(GTK_ACTION(act15->gobj()), c1); + g_object_set_data(G_OBJECT(toolbox), "freeze", GINT_TO_POINTER(FALSE)); // unfreeze (see above) } |
