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

Side by Side Diff: ash/magnifier/magnification_controller.cc

Issue 14466005: Magnifier: Prevent the cursor jumping on HiDPI display. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/magnifier/magnification_controller.h" 5 #include "ash/magnifier/magnification_controller.h"
6 6
7 #include "ash/ash_root_window_transformer.h" 7 #include "ash/ash_root_window_transformer.h"
8 #include "ash/display/display_controller.h" 8 #include "ash/display/display_controller.h"
9 #include "ash/display/display_manager.h" 9 #include "ash/display/display_manager.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 25 matching lines...) Expand all
36 const float kNonMagnifiedScale = 1.0f; 36 const float kNonMagnifiedScale = 1.0f;
37 37
38 const float kInitialMagnifiedScale = 2.0f; 38 const float kInitialMagnifiedScale = 2.0f;
39 const float kScrollScaleChangeFactor = 0.05f; 39 const float kScrollScaleChangeFactor = 0.05f;
40 40
41 // Threadshold of panning. If the cursor moves to within pixels (in DIP) of 41 // Threadshold of panning. If the cursor moves to within pixels (in DIP) of
42 // |kPanningMergin| from the edge, the view-port moves. 42 // |kPanningMergin| from the edge, the view-port moves.
43 const int kPanningMergin = 100; 43 const int kPanningMergin = 100;
44 44
45 void MoveCursorTo(aura::RootWindow* root_window, 45 void MoveCursorTo(aura::RootWindow* root_window,
46 const gfx::Point root_location) { 46 const gfx::Point& root_location) {
47 gfx::Point3F host_location_3f(root_location); 47 gfx::Point3F host_location_3f(root_location);
48 root_window->layer()->transform().TransformPoint(host_location_3f); 48 root_window->GetRootTransform().TransformPoint(host_location_3f);
49 root_window->MoveCursorToHostLoation( 49 root_window->MoveCursorToHostLoation(
50 gfx::ToCeiledPoint(host_location_3f.AsPointF())); 50 gfx::ToCeiledPoint(host_location_3f.AsPointF()));
oshima 2013/04/30 23:03:07 We have this rounding issue because we're converti
51 } 51 }
52 52
53 } // namespace 53 } // namespace
54 54
55 namespace ash { 55 namespace ash {
56 56
57 //////////////////////////////////////////////////////////////////////////////// 57 ////////////////////////////////////////////////////////////////////////////////
58 // MagnificationControllerImpl: 58 // MagnificationControllerImpl:
59 59
60 class MagnificationControllerImpl : virtual public MagnificationController, 60 class MagnificationControllerImpl : virtual public MagnificationController,
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 619
620 //////////////////////////////////////////////////////////////////////////////// 620 ////////////////////////////////////////////////////////////////////////////////
621 // MagnificationController: 621 // MagnificationController:
622 622
623 // static 623 // static
624 MagnificationController* MagnificationController::CreateInstance() { 624 MagnificationController* MagnificationController::CreateInstance() {
625 return new MagnificationControllerImpl(); 625 return new MagnificationControllerImpl();
626 } 626 }
627 627
628 } // namespace ash 628 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698