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

Unified Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix step one more time Created 8 years, 2 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: content/browser/renderer_host/render_widget_host_view_aura.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
index 1f873add3493bf3a1089f161a57b39cd15475075..516f2d9e99e04b084d719de72c486facde3f3814 100644
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
@@ -446,7 +446,7 @@ gfx::NativeViewAccessible RenderWidgetHostViewAura::GetNativeViewAccessible() {
}
void RenderWidgetHostViewAura::MovePluginWindows(
- const gfx::Point& scroll_offset,
+ const gfx::Vector2d& scroll_offset,
const std::vector<webkit::npapi::WebPluginGeometry>& plugin_window_moves) {
#if defined(OS_WIN)
// We need to clip the rectangle to the tab's viewport, otherwise we will draw
@@ -464,14 +464,12 @@ void RenderWidgetHostViewAura::MovePluginWindows(
for (size_t i = 0; i < moves.size(); ++i) {
gfx::Rect clip = moves[i].clip_rect;
- clip.Offset(moves[i].window_rect.origin());
- clip.Offset(scroll_offset);
+ clip.Offset(moves[i].window_rect.OffsetFromOrigin() + scroll_offset);
Peter Kasting 2012/10/31 01:04:41 One other possible way to do this I didn't think o
danakj 2012/10/31 16:55:46 I like temp vars :) I'll do this.
clip.Intersect(view_port);
- clip.Offset(-moves[i].window_rect.x(), -moves[i].window_rect.y());
- clip.Offset(-scroll_offset.x(), -scroll_offset.y());
+ clip.Offset(-moves[i].window_rect.OffsetFromOrigin() - scroll_offset);
moves[i].clip_rect = clip;
- moves[i].window_rect.Offset(view_bounds.origin());
+ moves[i].window_rect.Offset(view_bounds.OffsetFromOrigin());
}
MovePluginWindowsHelper(parent, moves);

Powered by Google App Engine
This is Rietveld 408576698