[html5] Proposal for a hair width/line property when using <canvas> tag

Shaun Morris shaunwithanau at gmail.com
Thu Feb 4 06:57:28 PST 2010


Hi all,

I am working for a company who is currently trying to reproduce engineering
drawings made in AutoCad within the canvas tag as a way to step away from
the legacy way of doing it using Java and being stuck in IE.

These drawings like many engineering drawings or mapping applications have
to be scaled considerably and the current problem is that after scaling a
line with a lineWidth of 1 after being scaled 5x's has a lineWidth of 5.

I understand the importance of not relying on pixel measurements for
everyday use. However this becomes a problem for users who are trying to
implement canvas for data, such as a map, chart, or engineering drawing
which sometime need this exact specification.

What I am suggesting is implementing something like a hairwidth property. In
other graphics programs this means being able to set a lineWidth, of for
example 1 px, and even after scaling this line remains 1 px wide.

Still other graphics programs implement this feature if lineWidth is set
equal to 0 rather than just ignoring it.

The reason I bring this up is because I know it is possible as the latest
builds of Chrome for Windows currently treat lines as such.

If no linewidth is explicitly set (e.g. the default linewidth of 1 px is
assumed) and then the drawing is scaled those lines remain 1 px wide.
However, I was disappointed to learn that this is apparently a bug as none
of the other major browsers (IE w/ Excanvas, FF, Safari, Opera, and even the
Mac build of Chrome) treat lines this way.

My current alternative : If this is not fixed, I do have an alternative
which is do all my scaling on individual points, radii, etc. I know this,
but when I have something as convenient and graceful as being able to scale
the whole canvas it would be so much nicer than having to scale every object
placed on the canvas.

This is why I came here to get your opinions on the matter. If there are
other alternatives I would love to hear those too.

--

Shaun Morris
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/help-whatwg.org/attachments/20100204/729314d1/attachment-0001.htm>


More information about the Help mailing list