Chromium Code Reviews| 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); |