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

Side by Side Diff: ui/touch_selection/touch_handle_drawable_aura.cc

Issue 1404163004: Swap touch selection handles when they are interchanged (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: linux build error Created 5 years 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
« no previous file with comments | « no previous file | ui/touch_selection/touch_selection_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "ui/touch_selection/touch_handle_drawable_aura.h" 5 #include "ui/touch_selection/touch_handle_drawable_aura.h"
6 6
7 #include "ui/aura/window.h" 7 #include "ui/aura/window.h"
8 #include "ui/aura/window_targeter.h" 8 #include "ui/aura/window_targeter.h"
9 #include "ui/aura_extra/image_window_delegate.h" 9 #include "ui/aura_extra/image_window_delegate.h"
10 #include "ui/base/cursor/cursor.h" 10 #include "ui/base/cursor/cursor.h"
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 window_delegate_->SetImage(*image); 110 window_delegate_->SetImage(*image);
111 111
112 // Calculate the relative bounds. 112 // Calculate the relative bounds.
113 gfx::Size image_size = image->Size(); 113 gfx::Size image_size = image->Size();
114 int window_width = image_size.width() + 2 * kSelectionHandlePadding; 114 int window_width = image_size.width() + 2 * kSelectionHandlePadding;
115 int window_height = image_size.height() + 2 * kSelectionHandlePadding; 115 int window_height = image_size.height() + 2 * kSelectionHandlePadding;
116 relative_bounds_ = 116 relative_bounds_ =
117 gfx::RectF(-kSelectionHandlePadding, 117 gfx::RectF(-kSelectionHandlePadding,
118 kSelectionHandleVerticalVisualOffset - kSelectionHandlePadding, 118 kSelectionHandleVerticalVisualOffset - kSelectionHandlePadding,
119 window_width, window_height); 119 window_width, window_height);
120 gfx::Rect paint_bounds(relative_bounds_.x(), relative_bounds_.y(),
121 relative_bounds_.width(), relative_bounds_.height());
mohsen 2015/12/21 21:05:50 I think you should've used gfx::ToEnclosingRect()
122 window_->SchedulePaintInRect(paint_bounds);
120 UpdateBounds(); 123 UpdateBounds();
121 } 124 }
122 125
123 void TouchHandleDrawableAura::SetOrigin(const gfx::PointF& position) { 126 void TouchHandleDrawableAura::SetOrigin(const gfx::PointF& position) {
124 origin_position_ = position; 127 origin_position_ = position;
125 UpdateBounds(); 128 UpdateBounds();
126 } 129 }
127 130
128 void TouchHandleDrawableAura::SetAlpha(float alpha) { 131 void TouchHandleDrawableAura::SetAlpha(float alpha) {
129 if (alpha == alpha_) 132 if (alpha == alpha_)
(...skipping 15 matching lines...) Expand all
145 kSelectionHandlePadding); 148 kSelectionHandlePadding);
146 return bounds; 149 return bounds;
147 } 150 }
148 151
149 float TouchHandleDrawableAura::GetDrawableHorizontalPaddingRatio() const { 152 float TouchHandleDrawableAura::GetDrawableHorizontalPaddingRatio() const {
150 // Aura does not have any transparent padding for its handle drawable. 153 // Aura does not have any transparent padding for its handle drawable.
151 return 0.0f; 154 return 0.0f;
152 } 155 }
153 156
154 } // namespace ui 157 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/touch_selection/touch_selection_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698