2014-04-11 22:38 GMT+02:00 Josh Andler <scislac@...400...>:
Is the Visual Bounding box an actual SVG thing? Or is it an Inkscape thing? If an Inkscape thing, theoretically we could just add another bounding box mode... something like Logical Bounding Box.
It is an Inkscape thing.
Inkscape has two ways of computing the bounding box, and you can select which one is used to draw the selection cue in the preferences of the selector tool. The first is the "geometric bounding box", which corresponds to the SVG bbox used to evaluate objectBoundingBox coordinates. It ignores stroke, clipping, masking, etc. The second is "visual bounding box", which is a tight fit over the area visually affected by the object - it considers the effect of clipping, masking, stroke, filters, and so on.
If we are to maintain this definition, then the geometric bounding box of text should include leading/trailing whitespace, but the visual one shouldn't. Note that there is no requirement for the geometric bbox to be contained in the visual bbox. They can be completely unrelated, because they are used for different purposes.
As for leading: In Draw, you can't even add leading whitespace. It just moves the exiting text object forward by the expected distance... it feels really weird. In AI, you can add it, it is selectable, it expands their bbox.
As for trailing: In Draw you can add it, it is not selectable with the selection tool and does not expand their bbox. In AI, treats it like it does leading.
To me, I think AI's way is just more logical... if you are adding spaces at the beginning or end of text, you are probably intentionally doing it for some reason.
Adding leading whitespace should not move the text anchor, but it also shouldn't expand the visual bbox or the pickbox. Selecting a text object by clicking on a blank area (especially leading / trailing whitespace) is inconsistent with the rest of Inkscape, with the possible exception of filters with too large filter regions (which should be fixed anyway).
As mentioned in the bug report discussion, if we're going to be nitpicky about the Visual bbox, it's pretty broken when using filters as far as a user is concerned.
That's a different problem.
We could automatically set the filter region based on the filter's primitives and settings, and we in fact already perform this kind of calculation when rendering the filter.
Regards, Krzysztof