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

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: 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..e4ca846a32c94452b34232646f1fcb8a271c2b58 100644
--- a/sky/engine/core/rendering/RenderIFrame.cpp
+++ b/sky/engine/core/rendering/RenderIFrame.cpp
@@ -34,11 +34,13 @@ void RenderIFrame::updateWidgetBounds()
return;
IntRect bounds = absoluteContentBox();
+ const float scaleFactor =
abarth-chromium 2015/02/04 16:41:11 scaleFactor -> devicePixelRatio
tonyg 2015/02/04 16:56:37 Done.
+ contentView->GetRoot()->viewport_metrics().device_pixel_ratio;
mojo::Rect mojoBounds;
- mojoBounds.x = bounds.x();
- mojoBounds.y = bounds.y();
- mojoBounds.width = bounds.width();
- mojoBounds.height = bounds.height();
+ mojoBounds.x = bounds.x() * scaleFactor;
+ mojoBounds.y = bounds.y() * scaleFactor;
+ mojoBounds.width = bounds.width() * scaleFactor;
+ mojoBounds.height = bounds.height() * scaleFactor;
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