Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Lines are too thick

10 views
Skip to first unread message

eddy

unread,
Jun 24, 2009, 7:46:11 AM6/24/09
to
Hi,

I am trying to draw an svg image in Firefox with dojo. It works fine,
except 1px line are really 2 or 3 pixels wide which is very
annoying...

Heres my HTML header:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" >


and here the SVG graphic:
<div id="canvas" style="width: 1000px; height: 1000px;">
<svg width="1000" height="1000"><defs/><g/><rect fill="none" fill-
opacity="0" stroke="rgb(170, 170, 170)" stroke-opacity="1" stroke-
width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-
miterlimit="4" x="0" y="0" width="100" height="1000" stroke-
dasharray="none" dojoGfxStrokeStyle="Solid"/><rect fill="rgb(255, 0,
0)" fill-opacity="1" stroke="rgb(0, 0, 255)" stroke-opacity="1" stroke-
width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-
miterlimit="4" x="100" y="50" width="100" height="100" fill-
rule="evenodd" stroke-dasharray="none" dojoGfxStrokeStyle="solid"/></
svg></div>

Any ideas on why this might be?

Thanks,


Eddy

Boris Zbarsky

unread,
Jun 24, 2009, 8:24:37 AM6/24/09
to
eddy wrote:
> I am trying to draw an svg image in Firefox with dojo. It works fine,
> except 1px line are really 2 or 3 pixels wide which is very
> annoying...
....

> <rect fill="none" fill-
> opacity="0" stroke="rgb(170, 170, 170)" stroke-opacity="1" stroke-
> width="1" stroke-linecap="butt" stroke-linejoin="miter" stroke-
> miterlimit="4" x="0" y="0" width="100" height="1000" stroke-
> dasharray="none" dojoGfxStrokeStyle="Solid"/>
...

> Any ideas on why this might be?

http://www.cairographics.org/FAQ/#sharp_lines I suspect, given the
coordinates of your rectangle. Put simply, you're trying to draw your
line exactly halfway between two screen dots, so it ends up covering
both of them.

-Boris

0 new messages