Index: third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp |
diff --git a/third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp b/third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp |
index ad84527ad8b9630f4f10859f763e861e6a135025..f3267fad8448bd0fe89bb208b7db21a53da98a2d 100644 |
--- a/third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp |
+++ b/third_party/WebKit/Source/core/paint/MediaControlsPainter.cpp |
@@ -31,6 +31,7 @@ |
#include "core/html/HTMLMediaElement.h" |
#include "core/html/TimeRanges.h" |
#include "core/html/shadow/MediaControlElementTypes.h" |
+#include "core/html/shadow/MediaControls.h" |
#include "core/layout/LayoutBox.h" |
#include "core/paint/PaintInfo.h" |
#include "core/style/ComputedStyle.h" |
@@ -176,6 +177,10 @@ bool MediaControlsPainter::paintMediaOverlayPlayButton( |
if (!hasSource(mediaElement) || !mediaElement->paused()) |
return false; |
+ MediaControlPanelElement* panelElement = nullptr; |
+ if (mediaElement->mediaControls()) |
+ panelElement = mediaElement->mediaControls()->panelElement(); |
+ |
static Image* mediaOverlayPlay = platformResource("mediaplayerOverlayPlay"); |
IntRect buttonRect(rect); |
@@ -187,9 +192,12 @@ bool MediaControlsPainter::paintMediaOverlayPlayButton( |
if (!box) |
return false; |
int mediaHeight = box->pixelSnappedHeight(); |
+ int mediaPanelHeight = 0; |
+ if (panelElement) |
+ mediaPanelHeight = panelElement->clientHeight(); |
mlamouri (slow - plz ping)
2017/03/08 19:13:04
I'm a huge fan of ternary operator and I would obv
steimel
2017/03/09 16:42:24
Done.
|
buttonRect.setX(rect.center().x() - mediaOverlayPlayButtonWidth / 2); |
buttonRect.setY(rect.center().y() - mediaOverlayPlayButtonHeight / 2 + |
- (mediaHeight - rect.height()) / 2); |
+ (mediaHeight - rect.height() - mediaPanelHeight) / 2); |
buttonRect.setWidth(mediaOverlayPlayButtonWidth); |
buttonRect.setHeight(mediaOverlayPlayButtonHeight); |