Mouse click\select hitbox wrong

This is NOT a support forum. You are welcome to discuss software issues here, but all issues should be reported on Launchpad if you want them fixed.
nathanaa5
Posts: 2
Joined: Wed Nov 28, 2018 4:56 am

Mouse click\select hitbox wrong

Postby nathanaa5 » Wed Nov 28, 2018 5:08 am

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:Image 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 266 times

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Mouse click\select hitbox wrong

Postby brynn » Wed Nov 28, 2018 2:48 pm

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.

nathanaa5
Posts: 2
Joined: Wed Nov 28, 2018 4:56 am

Re: Mouse click\select hitbox wrong

Postby nathanaa5 » Sat Dec 01, 2018 9:26 am

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)

tylerdurden
Posts: 2344
Joined: Sun Apr 14, 2013 12:04 pm
Location: Michigan, USA

Re: Mouse click\select hitbox wrong

Postby tylerdurden » Sat Dec 01, 2018 11:36 am

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.

Image

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 261 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/

User avatar
brynn
Posts: 10309
Joined: Wed Sep 26, 2007 4:34 pm
Location: western USA
Contact:

Re: Mouse click\select hitbox wrong

Postby brynn » Sun Dec 02, 2018 3:29 pm

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.


Return to “Discuss Software Issues”