nitpicker: fix off-by-one bug
This commit is contained in:
parent
0150d02683
commit
e652af7518
|
@ -57,8 +57,8 @@ void User_state::handle_event(Input::Event ev)
|
||||||
/* transparently handle absolute and relative motion events */
|
/* transparently handle absolute and relative motion events */
|
||||||
if (type == Event::MOTION) {
|
if (type == Event::MOTION) {
|
||||||
if ((ev.rx() || ev.ry()) && ev.ax() == 0 && ev.ay() == 0) {
|
if ((ev.rx() || ev.ry()) && ev.ax() == 0 && ev.ay() == 0) {
|
||||||
ax = Genode::max(0, Genode::min((int)size().w(), ax + ev.rx()));
|
ax = Genode::max(0, Genode::min((int)size().w() - 1, ax + ev.rx()));
|
||||||
ay = Genode::max(0, Genode::min((int)size().h(), ay + ev.ry()));
|
ay = Genode::max(0, Genode::min((int)size().h() - 1, ay + ev.ry()));
|
||||||
} else {
|
} else {
|
||||||
ax = ev.ax();
|
ax = ev.ax();
|
||||||
ay = ev.ay();
|
ay = ev.ay();
|
||||||
|
|
Loading…
Reference in New Issue