[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kmplayer/0.12] src: scheduleRepaint should be called with pixel coordinates
From: Koos Vriezen <koos.vriezen () gmail ! com>
Date: 2016-10-30 11:52:04
Message-ID: E1c0oei-0001fv-I3 () code ! kde ! org
[Download RAW message or body]
Git commit 5517262a2a328518dd42a8aa0e37a34152a06282 by Koos Vriezen.
Committed on 30/10/2016 at 11:50.
Pushed by vriezen into branch '0.12'.
scheduleRepaint should be called with pixel coordinates
M +26 -5 src/viewarea.cpp
http://commits.kde.org/kmplayer/5517262a2a328518dd42a8aa0e37a34152a06282
diff --git a/src/viewarea.cpp b/src/viewarea.cpp
index 24f68cf..e4df941 100644
--- a/src/viewarea.cpp
+++ b/src/viewarea.cpp
@@ -2117,9 +2117,20 @@ KDE_NO_EXPORT void ViewArea::syncVisual () {
KDE_NO_EXPORT void ViewArea::paintEvent (QPaintEvent * pe) {
#ifdef KMPLAYER_WITH_CAIRO
- if (surface->node)
- scheduleRepaint (IRect (pe->rect ().x (), pe->rect ().y (), pe->rect \
().width (), pe->rect ().height ()));
- else
+ if (surface->node) {
+#if QT_VERSION >= 0x050600
+ int x = (int)(pe->rect().x() * devicePixelRatioF());
+ int y = (int)(pe->rect().y() * devicePixelRatioF());
+ int w = (int)(pe->rect().width() * devicePixelRatioF());
+ int h = (int)(pe->rect().height() * devicePixelRatioF());
+#else
+ int x = pe->rect().x();
+ int y = pe->rect().y();
+ int w = pe->rect().width();
+ int h = pe->rect().height();
+#endif
+ scheduleRepaint(IRect(x, y, w, h));
+ } else
#endif
if (m_fullscreen || m_paint_background)
{
@@ -2647,8 +2658,18 @@ void VideoOutput::setGeometry (const IRect &rect) {
void VideoOutput::setAspect (float a) {
m_aspect = a;
QRect r = geometry ();
- m_view->viewArea ()->scheduleRepaint (
- IRect (r.x (), r.y (), r.width (), r.height ()));
+#if QT_VERSION >= 0x050600
+ int x = (int)(r.x() * devicePixelRatioF());
+ int y = (int)(r.y() * devicePixelRatioF());
+ int w = (int)(r.width() * devicePixelRatioF());
+ int h = (int)(r.height() * devicePixelRatioF());
+#else
+ int x = r.x();
+ int y = r.y();
+ int w = r.width();
+ int h = r.height();
+#endif
+ m_view->viewArea()->scheduleRepaint(IRect(x, y, w, h));
}
KDE_NO_EXPORT void VideoOutput::map () {
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic