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

Unified Diff: sky/engine/core/rendering/RenderIFrame.cpp

Issue 896233002: Fix render bounds of iframes on devices with a pixel ratio != 1. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Address comments Created 5 years, 10 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/rendering/RenderIFrame.cpp
diff --git a/sky/engine/core/rendering/RenderIFrame.cpp b/sky/engine/core/rendering/RenderIFrame.cpp
index 76b09620fa6ee576c7e90a660fdc7bb7591db70d..b3f7768d50f528778c297d513b3221e05a274aeb 100644
--- a/sky/engine/core/rendering/RenderIFrame.cpp
+++ b/sky/engine/core/rendering/RenderIFrame.cpp
@@ -33,12 +33,17 @@ void RenderIFrame::updateWidgetBounds()
if (!contentView)
return;
+ // FIXME: Once viewport_metrics are initialized properly on child views,
+ // The GetRoot() call should be removed.
+ const float devicePixelRatio =
+ contentView->GetRoot()->viewport_metrics().device_pixel_ratio;
+
IntRect bounds = absoluteContentBox();
mojo::Rect mojoBounds;
- mojoBounds.x = bounds.x();
- mojoBounds.y = bounds.y();
- mojoBounds.width = bounds.width();
- mojoBounds.height = bounds.height();
+ mojoBounds.x = bounds.x() * devicePixelRatio;
+ mojoBounds.y = bounds.y() * devicePixelRatio;
+ mojoBounds.width = bounds.width() * devicePixelRatio;
+ mojoBounds.height = bounds.height() * devicePixelRatio;
contentView->SetBounds(mojoBounds);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698