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

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

Issue 766583002: ozone: dri: Support moving between displays in MoveCursorTo(location) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | ui/ozone/platform/caca/ozone_platform_caca.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d2ca2e3af95d6b0b4c6744b164992357ee784f6d..40bac2c017f213b45ee73e3d31d003c4308f1091 100644
--- a/ui/events/ozone/evdev/tablet_event_converter_evdev.cc
+++ b/ui/events/ozone/evdev/tablet_event_converter_evdev.cc
@@ -106,10 +106,15 @@ void TabletEventConverterEvdev::ConvertAbsEvent(const input_event& input) {
}
void TabletEventConverterEvdev::UpdateCursor() {
- int width = cursor_->GetCursorDisplayBounds().width();
- int height = cursor_->GetCursorDisplayBounds().height();
- int x = ((x_abs_location_ - x_abs_min_) * width) / x_abs_range_;
- int y = ((y_abs_location_ - y_abs_min_) * height) / y_abs_range_;
+ gfx::Rect display_bounds = cursor_->GetCursorDisplayBounds();
+
+ 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 += display_bounds.x();
+ y += display_bounds.y();
cursor_->MoveCursorTo(gfx::PointF(x, y));
}
« no previous file with comments | « no previous file | ui/ozone/platform/caca/ozone_platform_caca.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698