deltaluca / nape

Haxe/AS3 Physics Engine
http://napephys.com
Other
542 stars 77 forks source link

Question about debug lineStyle stroke thickness #69

Closed drkibitz closed 10 years ago

drkibitz commented 10 years ago

I noticed that the line style stroke thickness is set to 0.1 and wondered why that is? Why not just go with 1? I have implemented the samples in an OpenFL project and compiling them to all targets. What I found is that HTML5 actually tries to render the sub-pixel stroke thickness, which makes it very hard to see. All other targets appear to render the same with a stroke that is > 0 and <= 1.

deltaluca commented 10 years ago

You can set it yourself (ShapeDebug::thickness)

I choose 0.1 as the default as (at least on flash) this gives an always minimal thickness line, which is often thinner than a '1' thickness line when it comes to things that are non-vertical/horizontal.

drkibitz commented 10 years ago

These look hard coded to me:

Might also be helpful to just set this as the default value when defined? https://github.com/deltaluca/nape/blob/0cde90a1a0786c0520365d7201b52ab84451417d/cx-src/nape/util/ShapeDebug.cx#L54

deltaluca commented 10 years ago

Hahaha, you're very much right there ^^ ShapeDebug::thickness exists... but isn't being used :)

deltaluca commented 10 years ago

71