Since the device min/max x/y coordinates are inclusive, to get the
width/height one need to add one to (min x/y - max x/y).
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
li_fixed_t x,
uint32_t width)
{
- return (x - device->abs.min_x) * width /
- (device->abs.max_x - device->abs.min_x);
+ return (x - li_fixed_from_int(device->abs.min_x)) * width /
+ (device->abs.max_x - device->abs.min_x + 1);
}
li_fixed_t
li_fixed_t y,
uint32_t height)
{
- return (y - device->abs.min_y) * height /
- (device->abs.max_y - device->abs.min_y);
+ return (y - li_fixed_from_int(device->abs.min_y)) * height /
+ (device->abs.max_y - device->abs.min_y + 1);
}
static void