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

Unified Diff: ash/magnifier/magnification_controller.cc

Issue 1564973002: Don't center screen magnification on empty focus rectangle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add unit test Created 4 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
« no previous file with comments | « no previous file | ash/magnifier/magnification_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/magnifier/magnification_controller.cc
diff --git a/ash/magnifier/magnification_controller.cc b/ash/magnifier/magnification_controller.cc
index e4c5b8ee90b3a3d9a19f3fa8691338d23bb1d729..d0ec016cee9c646c61ff51072c9539a22c4f24d1 100644
--- a/ash/magnifier/magnification_controller.cc
+++ b/ash/magnifier/magnification_controller.cc
@@ -435,6 +435,10 @@ void MagnificationControllerImpl::HandleFocusedNodeChanged(
if (is_editable_node)
return;
+ // Nothing to recenter on.
+ if (node_bounds_in_screen.IsEmpty())
+ return;
+
gfx::Rect node_bounds_in_root =
ScreenUtil::ConvertRectFromScreen(root_window_, node_bounds_in_screen);
if (GetViewportRect().Contains(node_bounds_in_root))
« no previous file with comments | « no previous file | ash/magnifier/magnification_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698