can anybody explain this behavior? Is this in according with manual (API) that x2 and y2 coordinates should be out of range when drawin line around watch screen?
(This occures within simulator and also appears on VAHR fw3.8 - both with SDK 2.1.x and 2.2.x .)
function TestGraphics(dc) {
dc.clear();
var bgColor = Gfx.COLOR_DK_GRAY;
// example - no pixel in bottom-right corner
dc.setColor(0xFFFF00, bgColor); // YELLOW, BLACK
var x1 = 10;
var x2 = 13;
var y1 = 10;
var y2 = 13;
dc.drawLine(x1, y1, x1, y2); // vertical line, should be from y1 to y2 4px long, but is only 3px long!!!
dc.drawLine(x1, y2, x2, y2); // horizontal line: 4-th pixel from vertical line is drawn by x1 position, but it is only 3px long (from left to right) again !!!
dc.drawLine(x2, y1, x2, y2); // vertical line starting on y1 position - missing pixel on bottom-right corner !!!
// problem description
dc.setColor(0x00FF00, bgColor); //GREEN, BLACK
x1 = 20;
x2 = 23;
y1 = 10;
y2 = 13;
dc.drawLine(x1, y1, x1, y1); // THIS DOES NOT DRAW SINGLE PIXEL, but I think is should be drawed !
// OK, let's pretend, that x1-x1=0 pixels and y1-y1=0 pixels so it is posible to draw nothing :-)
// But!
// What in case I change only one of targeting coordinate?
dc.setColor(0xFF0000, bgColor); // RED, BLACK
x1 = 30;
y1 = 10;
dc.drawLine(x1, y1, x1, y1 + 1); // this draws one pixel. But it should not because x1-x1=0, so vertical width is zero !
dc.setColor(0x8800BB, bgColor); // BLUE, BLACK
// and more: drawing rectangle accepts width and height instead of x2 and y2, so:
dc.drawRectangle(0, 0, 148, 205); // needs 148 and 205, what means x1 = 0 but x2 should be not 204 (what is last line) but 205 for drawLine() !
dc.setColor(0x55FF00, bgColor); // YELLOW, BLACK
dc.drawLine(1, 0, 1, 204); // x2 is properly 204 but bottom line of rectangle is intact - is this logical? Why use x2=205 what is outside of range?
}
Thanks for answer and explaination.