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

Unified Diff: Source/core/paint/MediaControlsPainter.cpp

Issue 1296333002: Removed clientHeight() from MediaControlsPainter. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Use LayoutBox size instead. Created 5 years, 4 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: Source/core/paint/MediaControlsPainter.cpp
diff --git a/Source/core/paint/MediaControlsPainter.cpp b/Source/core/paint/MediaControlsPainter.cpp
index 21e8baebcf494a531e84babbaff431589830e6f5..9a5da42ee93c057339bbcf12a1b3cf43c05452da 100644
--- a/Source/core/paint/MediaControlsPainter.cpp
+++ b/Source/core/paint/MediaControlsPainter.cpp
@@ -173,7 +173,10 @@ bool MediaControlsPainter::paintMediaOverlayPlayButton(LayoutObject* object, con
if (RuntimeEnabledFeatures::newMediaPlaybackUiEnabled()) {
// Overlay play button covers the entire player, so center and draw a
// smaller button. Center in the entire element.
- int mediaHeight = mediaElement->clientHeight();
+ const LayoutBox* box = mediaElement->layoutObject()->enclosingBox();
liberato (no reviews please) 2015/08/18 16:26:41 That was much easier than i expected. gets rid of
fs 2015/08/18 16:41:19 You mean the stuff in MediaControls::notifyPanelWi
+ if (!box)
+ return false;
+ int mediaHeight = ceil(box->size().height().toDouble());
fs 2015/08/18 16:41:18 You could consider using pixelSnappedHeight() here
buttonRect.setX(rect.center().x() - mediaOverlayPlayButtonWidthNew / 2);
buttonRect.setY(rect.center().y() - mediaOverlayPlayButtonHeightNew / 2
+ (mediaHeight - rect.height()) / 2);
« 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