[SCM] ktexteditor packaging branch, master, updated. debian/5.28.0-1-5-g21891b5

Maximiliano Curia maxy at moszumanska.debian.org
Fri Apr 7 09:58:14 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/frameworks/ktexteditor.git;a=commitdiff;h=9c6fd4d

The following commit has been merged in the master branch:
commit 9c6fd4d602eda1dabe6b5e68bf05c10cb84e1a5a
Author: Maximiliano Curia <maxy at gnuservers.com.ar>
Date:   Fri Apr 7 11:27:37 2017 +0200

    Apply "fix minimap rendering for HiDPI envs" (030c37b)
    
    Add upstream patch as: fix-minimap-rendering-for-HiDPI-envs.patch
    
    Gbp-Dch: Full
---
 .../fix-minimap-rendering-for-HiDPI-envs.patch     | 64 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 65 insertions(+)

diff --git a/debian/patches/fix-minimap-rendering-for-HiDPI-envs.patch b/debian/patches/fix-minimap-rendering-for-HiDPI-envs.patch
new file mode 100644
index 0000000..e2092c3
--- /dev/null
+++ b/debian/patches/fix-minimap-rendering-for-HiDPI-envs.patch
@@ -0,0 +1,64 @@
+From: Christoph Cullmann <cullmann at kde.org>
+Date: Mon, 9 Jan 2017 06:17:42 +0100
+Subject: fix minimap rendering for HiDPI envs
+
+Differential Revision: https://phabricator.kde.org/D4018
+---
+ src/view/kateviewhelpers.cpp | 15 ++++++++++-----
+ 1 file changed, 10 insertions(+), 5 deletions(-)
+
+diff --git a/src/view/kateviewhelpers.cpp b/src/view/kateviewhelpers.cpp
+index e74a237e..3b45d8d4 100644
+--- a/src/view/kateviewhelpers.cpp
++++ b/src/view/kateviewhelpers.cpp
+@@ -476,7 +476,8 @@ void KateScrollBar::updatePixmap()
+     modifiedLineColor.setHsv(modifiedLineColor.hue(), 255, 255 - backgroundColor.value() / 3);
+     savedLineColor.setHsv(savedLineColor.hue(), 100, 255 - backgroundColor.value() / 3);
+ 
+-    m_pixmap = QPixmap(pixmapLineWidth, pixmapLineCount);
++    // increase dimensions by ratio
++    m_pixmap = QPixmap(pixmapLineWidth * m_view->devicePixelRatio(), pixmapLineCount * m_view->devicePixelRatio());
+     m_pixmap.fill(QColor("transparent"));
+ 
+     // The text currently selected in the document, to be drawn later.
+@@ -583,6 +584,10 @@ void KateScrollBar::updatePixmap()
+             }
+         }
+     }
++
++    // set right ratio
++    m_pixmap.setDevicePixelRatio(m_view->devicePixelRatio());
++
+     //qCDebug(LOG_KTE) << time.elapsed();
+     // Redraw the scrollbar widget with the updated pixmap.
+     update();
+@@ -627,7 +632,7 @@ void KateScrollBar::miniMapPaintEvent(QPaintEvent *e)
+     //style()->drawControl(QStyle::CE_ScrollBarSubLine, &opt, &painter, this);
+ 
+     // calculate the document size and position
+-    const int docHeight = qMin(grooveRect.height(), m_pixmap.height() * 2) - 2 * docXMargin;
++    const int docHeight = qMin(grooveRect.height(), int(m_pixmap.height() / m_pixmap.devicePixelRatio() * 2)) - 2 * docXMargin;
+     const int yoffset = 1; // top-aligned in stead of center-aligned (grooveRect.height() - docHeight) / 2;
+     const QRect docRect(QPoint(grooveRect.left() + docXMargin, yoffset + grooveRect.top()), QSize(grooveRect.width() - docXMargin, docHeight));
+     m_mapGroveRect = docRect;
+@@ -683,17 +688,17 @@ void KateScrollBar::miniMapPaintEvent(QPaintEvent *e)
+     }
+ 
+     // Smooth transform only when squeezing
+-    if (grooveRect.height() < m_pixmap.height()) {
++    if (grooveRect.height() < m_pixmap.height() / m_pixmap.devicePixelRatio()) {
+         painter.setRenderHint(QPainter::SmoothPixmapTransform);
+     }
+ 
+     // draw the modified lines margin
+-    QRect pixmapMarginRect(QPoint(0, 0), QSize(s_pixelMargin, m_pixmap.height()));
++    QRect pixmapMarginRect(QPoint(0, 0), QSize(s_pixelMargin, m_pixmap.height() / m_pixmap.devicePixelRatio()));
+     QRect docPixmapMarginRect(QPoint(0, docRect.top()), QSize(s_pixelMargin, docRect.height()));
+     painter.drawPixmap(docPixmapMarginRect, m_pixmap, pixmapMarginRect);
+ 
+     // calculate the stretch and draw the stretched lines (scrollbar marks)
+-    QRect pixmapRect(QPoint(s_pixelMargin, 0), QSize(m_pixmap.width() - s_pixelMargin, m_pixmap.height()));
++    QRect pixmapRect(QPoint(s_pixelMargin, 0), QSize(m_pixmap.width() / m_pixmap.devicePixelRatio() - s_pixelMargin, m_pixmap.height() / m_pixmap.devicePixelRatio()));
+     QRect docPixmapRect(QPoint(s_pixelMargin, docRect.top()), QSize(docRect.width() - s_pixelMargin, docRect.height()));
+     painter.drawPixmap(docPixmapRect, m_pixmap, pixmapRect);
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 4f7d3c1..24cc37f 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 katesyntaxtest_check_basename
 Fix-Forward-dragging-text-results-in-wrong-selection.patch
+fix-minimap-rendering-for-HiDPI-envs.patch

-- 
ktexteditor packaging



More information about the pkg-kde-commits mailing list