Hi Dan.
dancooperstock:
> I'm working in Firefox 1.5. If I have the following SVG code:
>
> <line x1="10" y1="100" x2="10" y2="140" stroke="gray" stroke-width="1"/>
> <line x1="10" y1="100" x2="10" y2="170" stroke="gray" stroke-width="1"/>
>
> then the overlapping part (from y value 100 down to 140) looks darker
> than the non-overlapping part (from 140 down to 170). I've tried
> messing with opacity settings (like setting it to 1) but that makes no
> difference.
The issue is with anti-aliasing and the way the coordinate system works
in SVG. If one user unit in your SVG maps to one pixel as rendered by
Firefox, and if anti-aliasing is used when drawing, then drawing
horizontal or vertical lines with integer coordinate values with a
stroke-width of 1 will result in the line straddling pixels. This is
because the integer coordinate values lie between the pixels in this
case, and a stroke-width of 1 will cause half of the stroke line to
drawn on one pixel, and the other half on the adjacent pixel--each with
0.5 opacity. When the two coincident lines are drawn, their semi-opaque
pixels add together.
You could do two things to avoid this:
* force your lines to be rendered exactly on pixels by subtracting 0.5
from your coordinates, e.g.:
<g stroke="gray" stroke-width="1" transform="translate(-0.5)">
<line x1="10" y1="100" x2="10" y2="140"/>
<line x1="10" y1="100" x2="10" y2="170"/>
</g>
* set shape-rendering="crispEdges" to force anti-aliasing to be turned
off for these lines:
<g stroke="gray" stroke-width="1" shape-rendering="crispEdges">
<line x1="10" y1="100" x2="10" y2="140"/>
<line x1="10" y1="100" x2="10" y2="170"/>
</g>
--
Cameron McCormack ICQ: 26955922
cam (at) mcc.id.au MSN: cam (at) mcc.id.au
http://mcc.id.au/ JBR: heycam (at) jabber.org
------------------------ Yahoo! Groups Sponsor --------------------~-->
Everything you need is one click away. Make Yahoo! your home page now.
http://us.click.yahoo.com/AHchtC/4FxNAA/yQLSAA/1U_rlB/TM
--------------------------------------------------------------------~->
-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my
membership"
----
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/svg-developers/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/