Hi, I'm having some trouble with something basic and wondering if someone out there can shoot me the answer:
When creating an object on the grid with snapping enabled, this causes the edge or corners of the bounding box to snap to the gridline(s). However if the object has a border, by default Inkscape seems to always want to snap to the middle of the border.
In other words - what we have after snapping an object with a 1px border to a gridline, is an object with a border that is 0.5px inside the grid, and 0.5px outside the grid. The border is straddling the grid.
What is the magic button or preferences setting that will get our objects so that the outer edge of the border is snuggly inside the gridline with the rest of the object?
Snapping: Keeping borders inside gridlines
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: Snapping: Keeping borders inside gridlines
Ensure that snapping to nodes is turned off, and bounding box snapping should deliver the desired result.
http://tavmjong.free.fr/INKSCAPE/MANUAL ... ng-Objects
Regards,
TD
http://tavmjong.free.fr/INKSCAPE/MANUAL ... ng-Objects
Regards,
TD
Have a nice day.
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: Snapping: Keeping borders inside gridlines
Caveat:
"Note
The visual bounding box is determined by assuming that the Join style is Round."
http://tavmjong.free.fr/INKSCAPE/MANUAL ... Stroke-Cap
"Note
The visual bounding box is determined by assuming that the Join style is Round."
http://tavmjong.free.fr/INKSCAPE/MANUAL ... Stroke-Cap
Have a nice day.
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
I'm using Inkscape 0.92.2 (5c3e80d, 2017-08-06), 64 bit win8.1
The Inkscape manual has lots of helpful info! http://tavmjong.free.fr/INKSCAPE/MANUAL/html/
Re: Snapping: Keeping borders inside gridlines
tylerdurden wrote:Ensure that snapping to nodes is turned off, and bounding box snapping should deliver the desired result.
http://tavmjong.free.fr/INKSCAPE/MANUAL ... ng-Objects
Regards,
TD
Thanks. Tried this and still get the same result.
- Global snapping is on
- Snap bounding box corners is on.
- Join is set to Round in Stroke Style
- All snapping to Nodes are disabled
The border still straddles the line of the grid.

A manual I've been using ("Inkscape 0.48 Essentials for Web Designers) actually mentions this issue, took the effort to include
a figure illustrating this, but completely omits how to actually do it! Hence why I am posting. Here's a screenshot from the book:

On a related note - the only way I can seem to get snapping to work at all in this program is "Snap to bounding box corners". All the other settings
I've tried I cant seem to get to work at all. "Snap to bounding box corners" with the stroke straddling halfway over a grid line is the best I can make
it do so far.
I'm switching over from using Fireworks for years. Adobes pricing model is ridiculous now, + they've stopped supporting it altogther apparently. So I am
working hard at this to try and make it work but a few of these niggling issues are holding me back .. please tell me I'm missing sthing obvious!
Re: Snapping: Keeping borders inside gridlines
Hi.
Are you after a way to draw pixel fitted imagery?
With your stoke widths not being even pixels, the inner edge of the lines would fall off the grid.
Thus even if the object's bounding box is at the grid lines, if you export to png at 90 dpi the stroke would get anti-aliased and look blurred.
By setting the line width to 1 px it wouldn't matter much if all the nodes are snapping, or the bounding box -if right exporting area is set-.
Are you after a way to draw pixel fitted imagery?
With your stoke widths not being even pixels, the inner edge of the lines would fall off the grid.
Thus even if the object's bounding box is at the grid lines, if you export to png at 90 dpi the stroke would get anti-aliased and look blurred.
By setting the line width to 1 px it wouldn't matter much if all the nodes are snapping, or the bounding box -if right exporting area is set-.
Re: Snapping: Keeping borders inside gridlines
Hi vongoh,
Please check if in the preferences the bounding box has been set to "visual bounding box"; Ctrl-Shift-P -> Tools -> Visual bounding box
Please check if in the preferences the bounding box has been set to "visual bounding box"; Ctrl-Shift-P -> Tools -> Visual bounding box
Re: Snapping: Keeping borders inside gridlines
dvlierop wrote:Hi vongoh,
Please check if in the preferences the bounding box has been set to "visual bounding box"; Ctrl-Shift-P -> Tools -> Visual bounding box
Yes!

Essentially what I was looking for is the graphics editor version of CSS3
Code: Select all
box-sizing: border box;
inside the overall calculation of object size.
Thanks!