Mouse click\select hitbox wrong
Mouse click\select hitbox wrong
In the attached file, the "hitbox" for clicking on an object does not line up with the visual object on screen. For example clicking here: focuses the focused box. This occurs for all objects in this file making it really difficult to select. The painted image is in the correct location - the clickable zone is incorrect - I verified that by moving an object to "0, 0" and the painted image moved to the correct spot. Newly created objects in this file exhibit the same behavior - if you try and create a box it will not draw under the mouse but will draw up and to the left.
- Attachments
-
- Top.svg
- (6.92 KiB) Downloaded 268 times
Re: Mouse click\select hitbox wrong
Hhmm.... What is the source of this file? Was it converted from another format, or originally drawn in another program?
What I see on the canvas, is that the style indicator section of the status bar indicates that the objects have a 107 px wide stroke. The Stroke Style tab of Fill and Stroke dialog also reports the same. And indeed, the Selection tool seems to think the strokes are that wide.
However, the strokes don't visually appear to be so wide. And the XML Editor reports them as 2.84etc px. Visually they look more like 2 px wide.
Let's see if these things can be edited successfully.... Hhmm....not so much. If I change the stroke width to 1.0 you can hardly see it.
There's something in the XML Editor which I've never seen, and I don't know what it is. In the style attribute, I see
"vector-effect:non-scaling-stroke"
I don't know what "vector-effect" means. I wonder what would happen if I deleted that part? Yeah, when I deleted that part, the stroke width on the canvas now looks like it's 107 px wide!
So you could fix the file by deleting "vector-effect:non-scaling-stroke" from the style attribute in the XML Editor, for each and every object. And then edit the stroke widths for each and every object.
Or if you know where this file came from, which created this "vector-effect" value, and you could avoid that, it might be easier.
What I see on the canvas, is that the style indicator section of the status bar indicates that the objects have a 107 px wide stroke. The Stroke Style tab of Fill and Stroke dialog also reports the same. And indeed, the Selection tool seems to think the strokes are that wide.
However, the strokes don't visually appear to be so wide. And the XML Editor reports them as 2.84etc px. Visually they look more like 2 px wide.
Let's see if these things can be edited successfully.... Hhmm....not so much. If I change the stroke width to 1.0 you can hardly see it.
There's something in the XML Editor which I've never seen, and I don't know what it is. In the style attribute, I see
"vector-effect:non-scaling-stroke"
I don't know what "vector-effect" means. I wonder what would happen if I deleted that part? Yeah, when I deleted that part, the stroke width on the canvas now looks like it's 107 px wide!
So you could fix the file by deleting "vector-effect:non-scaling-stroke" from the style attribute in the XML Editor, for each and every object. And then edit the stroke widths for each and every object.
Or if you know where this file came from, which created this "vector-effect" value, and you could avoid that, it might be easier.
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Re: Mouse click\select hitbox wrong
So in summary, inkscape is handling "vector-effect:non-scaling-stroke" strangely? It displays as a very small stroke but the selection tools see it is as really large? Is there any way in the inkscape UI to turn this off? The SVG was generated by third part software (Fusion 360 onshape plugin)
-
- Posts: 2344
- Joined: Sun Apr 14, 2013 12:04 pm
- Location: Michigan, USA
Re: Mouse click\select hitbox wrong
You can probably delete all the "vector-effect:non-scaling-stroke" entries from the documents using a text editor like TextPad or Text-Wrangler.
But I don't trust the Shaper plug-in SVG files... the paths don't match the fills.
In the screen capture below, we see the object in Fusion and the resulting SVG. Visually, the fill looks correct, but the path shape does not correspond to the fill paint. If the path nodes are nudged up and back, the fill is re-written by Inkscape to match the path.
I'm not sure what the plug-in is doing, but I don't think it's totally kosher, and clearly not WYSIWYG.
But I don't trust the Shaper plug-in SVG files... the paths don't match the fills.
In the screen capture below, we see the object in Fusion and the resulting SVG. Visually, the fill looks correct, but the path shape does not correspond to the fill paint. If the path nodes are nudged up and back, the fill is re-written by Inkscape to match the path.
I'm not sure what the plug-in is doing, but I don't think it's totally kosher, and clearly not WYSIWYG.
- Attachments
-
- Body1a.svg
- (867 Bytes) Downloaded 262 times
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: Mouse click\select hitbox wrong
nathanaa5 wrote:So in summary, inkscape is handling "vector-effect:non-scaling-stroke" strangely? It displays as a very small stroke but the selection tools see it is as really large?
I'm not sure if Inkscape is handling it strangely or not. We'd have to ask developers about that. (Who knows, maybe the other program is using it strangely?) I just know that based on my tests, that's the culprit for the behavior you're seeing.
Basics - Help menu > Tutorials
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design
Manual - Inkscape: Guide to a Vector Drawing Program
Inkscape Community - Inkscape FAQ - Gallery
Inkscape for Cutting Design