I was playing around with HTML's Canvas element and I spent a whole day trying to figure out why I can't draw a 1-pixel wide straight line (parallel to the axes).
If you try dawing a black (#000000) straight line parallel to the axes, then for all odd numbered widths :
the first line is of colour #9d9d9d and the last one is of #8d8d8d
The width of the line is one pixel more
The above should give an output like this :
If you zooom in, you should be able to see the top and bottom border colours.
This happens in all canvas-supported browsers (FF 3, FF 3.5 beta 4, Opera 10 beta, Chrome 2 beta, Safari 4 beta).
Reason : https://developer.mozilla.org/en/Canvas_tutorial/Applying_styles_and_colors#section_8
Mozilla's canvas tutorial on drawing shapes shows a screenshot which has the inner most rectangle of exactly 1 pixel wide and colour black. But viewing the example itself in the browser, shows otherwise - 2 pixel wide with faded colours.
I've written a small function that draws exactly 1 pixel wide straight line parallel to the axis.
Like its sister sites, Royal Vegas is licensed by Malta Gaming Authority. If that does not occur, you'll need to contact the customer support team who will 메리트카지노 check the logs and act accordingly. Sign-up utilizing the super-short registration form, head to the 'Cashier' in either the on line casino or mobile app and make your first deposit and voila! At Jackpot City, players will profit from honest and tested games as the site is eCOGRA licensed. It has additionally gained the Best of Online Gaming award a number of} occasions. Jackpot City on-line on line casino authorized in Canada beneath the Kahnawake Gaming Commission.
2 comments:
That's a nice work around, but couldn't you have just centered the 1 pixel line half-way past your intended coordinate?
e.g.
ctx.beginPath();
ctx.moveTo(10.5, 0);
ctx.lineTo(10.5, 100);
ctx.lineWidth = 1;
ctx.stroke();
... would draw a solid, 1 pixel vertical line 100 pixels in length.
Like its sister sites, Royal Vegas is licensed by Malta Gaming Authority. If that does not occur, you'll need to contact the customer support team who will 메리트카지노 check the logs and act accordingly. Sign-up utilizing the super-short registration form, head to the 'Cashier' in either the on line casino or mobile app and make your first deposit and voila! At Jackpot City, players will profit from honest and tested games as the site is eCOGRA licensed. It has additionally gained the Best of Online Gaming award a number of} occasions. Jackpot City on-line on line casino authorized in Canada beneath the Kahnawake Gaming Commission.
Post a Comment