Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(542)

Unified Diff: ui/events/ozone/evdev/tablet_event_converter_evdev.cc

Issue 873563002: [Ozone] Constrain the cursor when overscan insets are set (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/events/ozone/evdev/tablet_event_converter_evdev.cc
diff --git a/ui/events/ozone/evdev/tablet_event_converter_evdev.cc b/ui/events/ozone/evdev/tablet_event_converter_evdev.cc
index 58dafb931298dbd787936cd77f758dde4b0badb6..1c28d5b83016135b7f770b69660ea3132c61959a 100644
--- a/ui/events/ozone/evdev/tablet_event_converter_evdev.cc
+++ b/ui/events/ozone/evdev/tablet_event_converter_evdev.cc
@@ -110,15 +110,15 @@ void TabletEventConverterEvdev::ConvertAbsEvent(const input_event& input) {
}
void TabletEventConverterEvdev::UpdateCursor() {
- gfx::Rect display_bounds = cursor_->GetCursorDisplayBounds();
+ gfx::Rect confined_bounds = cursor_->GetCursorConfinedBounds();
int x =
- ((x_abs_location_ - x_abs_min_) * display_bounds.width()) / x_abs_range_;
- int y =
- ((y_abs_location_ - y_abs_min_) * display_bounds.height()) / y_abs_range_;
+ ((x_abs_location_ - x_abs_min_) * confined_bounds.width()) / x_abs_range_;
+ int y = ((y_abs_location_ - y_abs_min_) * confined_bounds.height()) /
+ y_abs_range_;
- x += display_bounds.x();
- y += display_bounds.y();
+ x += confined_bounds.x();
+ y += confined_bounds.y();
cursor_->MoveCursorTo(gfx::PointF(x, y));
}
« no previous file with comments | « ui/events/ozone/evdev/input_injector_evdev_unittest.cc ('k') | ui/events/ozone/evdev/tablet_event_converter_evdev_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698