Position of the touch over a device.
Position (0, 0) is the window's bottom-left corner. This is consistent with how our 2D controls (TUIControl) treat all positions.
The position is expressed as a float value, to support backends that can report positions with sub-pixel accuracy. For example GTK and Android can do it, although it depends on underlying hardware capabilities as well. The top-right corner or the top-right pixel has the coordinates (Width, Height). Note that if you want to actually draw something at the window's edge (for example, paint the top-right pixel of the window with some color), then the pixel coordinates are (Width - 1, Height - 1). The idea is that the whole top-right pixel is an area starting in (Width - 1, Height - 1) and ending in (Width, Height).
Note that we have mouse capturing (when user presses and holds the mouse button, all the following mouse events are reported to this window, even when user moves the mouse outside of the window). This is typical of all window libraries (GTK, LCL etc.). This implicates that mouse positions are sometimes tracked also when mouse is outside the window, which means that mouse position may be outside the rectangle (0, 0) - (Width, Height), so it may even be negative.
|