Sorry for mudling the issue. After looking at my code again the reason I used 1.5 width and height is because x,y can be non-integer to enable smooth sub-pixel animation. The 1.5 enables a full pixel to be visible at all times, otherwise pixels seem to flicker as they move.<br>
<br>~Gerdus<br><br><div class="gmail_quote">On Thu, Apr 10, 2008 at 7:20 PM, Carl Worth <<a href="mailto:cworth@cworth.org">cworth@cworth.org</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Thu, 10 Apr 2008 18:13:23 +0200, "Gerdus van Zyl" wrote:<br>
> I use the following:<br>
> ctx.rectangle(p.x,p.y,1.5,1.5)<br>
> ctx.fill()<br>
><br>
> the reason for the 0.5 larger is the little squares,sample point model<br>
> described in "How do I draw a sharp, single-pixel-wide line?" in<br>
> <a href="http://www.cairographics.org/FAQ/#sharp_lines" target="_blank">http://www.cairographics.org/FAQ/#sharp_lines</a><br>
<br>
</div>Hi Gerdus,<br>
<br>
I think I really need to clarify that FAQ answer somehow. The correct<br>
code for drawing a single pixel, (assuming the default identity<br>
transformation matrix), is:<br>
<br>
cairo_rectangle (cr, x, y, 1.0, 1.0);<br>
cairo_fill (cr);<br>
<br>
with both x and y as integers.<br>
<br>
Please let me know what text on that page might have caused the<br>
misunderstanding so that I can fix it.<br>
<br>
Thanks,<br>
<font color="#888888"><br>
-Carl<br>
</font></blockquote></div><br>