Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 639722 Details for
Bug 723436
kde-misc/kdiff3-1.8.2-r1 blurry rendering on hi-dpi screen
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for kde-misc/kdiff3-1.8.2-r1
hidpi.patch (text/plain), 4.49 KB, created by
Михаил
on 2020-05-16 21:22:08 UTC
(
hide
)
Description:
patch for kde-misc/kdiff3-1.8.2-r1
Filename:
MIME Type:
Creator:
Михаил
Created:
2020-05-16 21:22:08 UTC
Size:
4.49 KB
patch
obsolete
>diff -Naur kdiff3-1.8.2/src/directorymergewindow.cpp kdiff3/src/directorymergewindow.cpp >--- kdiff3-1.8.2/src/directorymergewindow.cpp 2020-03-28 00:08:41.000000000 +0300 >+++ kdiff3/src/directorymergewindow.cpp 2020-05-16 23:51:28.628819480 +0300 >@@ -584,7 +584,10 @@ > //QPixmap icon = value.value<QPixmap>(); //pixmap(column); > if(!icon.isNull()) > { >- int yOffset = (sizeHint(option, index).height() - icon.height()) / 2; >+ const auto dpr = thePainter->device()->devicePixelRatioF(); >+ const int w = qRound(icon.width() / dpr); >+ const int h = qRound(icon.height() / dpr); >+ int yOffset = (sizeHint(option, index).height() - h) / 2; > thePainter->drawPixmap(x + 2, y + yOffset, icon); > > int i = index == d->m_selection1Index ? 1 : index == d->m_selection2Index ? 2 : index == d->m_selection3Index ? 3 : 0; >@@ -593,20 +596,20 @@ > Options* pOpts = d->m_pOptions; > QColor c(i == 1 ? pOpts->m_colorA : i == 2 ? pOpts->m_colorB : pOpts->m_colorC); > thePainter->setPen(c); // highlight() ); >- thePainter->drawRect(x + 2, y + yOffset, icon.width(), icon.height()); >+ thePainter->drawRect(x + 2, y + yOffset, w, h); > thePainter->setPen(QPen(c, 0, Qt::DotLine)); >- thePainter->drawRect(x + 1, y + yOffset - 1, icon.width() + 2, icon.height() + 2); >+ thePainter->drawRect(x + 1, y + yOffset - 1, w + 2, h + 2); > thePainter->setPen(Qt::white); > QString s(QChar('A' + i - 1)); > >- thePainter->drawText(x + 2 + (icon.width() - Utils::getHorizontalAdvance(thePainter->fontMetrics(), s)) / 2, >- y + yOffset + (icon.height() + thePainter->fontMetrics().ascent()) / 2 - 1, >+ thePainter->drawText(x + 2 + (w - Utils::getHorizontalAdvance(thePainter->fontMetrics(), s)) / 2, >+ y + yOffset + (h + thePainter->fontMetrics().ascent()) / 2 - 1, > s); > } > else > { > thePainter->setPen(m_pDMW->palette().window().color()); >- thePainter->drawRect(x + 1, y + yOffset - 1, icon.width() + 2, icon.height() + 2); >+ thePainter->drawRect(x + 1, y + yOffset - 1, w + 2, h + 2); > } > return; > } >diff -Naur kdiff3-1.8.2/src/main.cpp kdiff3/src/main.cpp >--- kdiff3-1.8.2/src/main.cpp 2020-03-28 00:08:41.000000000 +0300 >+++ kdiff3/src/main.cpp 2020-05-16 23:54:52.115359858 +0300 >@@ -80,6 +80,7 @@ > { > const QLatin1String appName("kdiff3"); > >+ QCoreApplication::setAttribute(Qt::AA_UseHighDpiPixmaps); > QApplication app(argc, argv); // KAboutData and QCommandLineParser depend on this being setup. > KLocalizedString::setApplicationDomain(appName.data()); > >diff -Naur kdiff3-1.8.2/src/mergeresultwindow.cpp kdiff3/src/mergeresultwindow.cpp >--- kdiff3-1.8.2/src/mergeresultwindow.cpp 2020-03-28 00:08:41.000000000 +0300 >+++ kdiff3/src/mergeresultwindow.cpp 2020-05-16 23:58:03.903812330 +0300 >@@ -1970,8 +1970,11 @@ > if(!m_bCursorUpdate) // Don't redraw everything for blinking cursor? > { > m_selection.bSelectionContainsData = false; >- if(size() != m_pixmap.size()) >- m_pixmap = QPixmap(size()); >+ const auto dpr = devicePixelRatioF(); >+ if(size() * dpr != m_pixmap.size()){ >+ m_pixmap = QPixmap(size() * dpr); >+ m_pixmap.setDevicePixelRatio(devicePixelRatioF()); >+ } > > RLPainter p(&m_pixmap, m_pOptions->m_bRightToLeftLanguage, width(), fontWidth); > p.setFont(font()); >diff -Naur kdiff3-1.8.2/src/Overview.cpp kdiff3/src/Overview.cpp >--- kdiff3-1.8.2/src/Overview.cpp 2020-03-28 00:08:41.000000000 +0300 >+++ kdiff3/src/Overview.cpp 2020-05-16 23:39:48.102500085 +0300 >@@ -271,7 +271,8 @@ > int h = height() - 1; > int w = width(); > >- if(m_pixmap.size() != size()) >+ const auto dpr = devicePixelRatioF(); >+ if(m_pixmap.size() != size() * dpr) > { > if(m_pOptions->m_bWordWrap) > { >@@ -287,7 +288,8 @@ > m_nofLines = m_pDiff3LineList->size(); > } > >- m_pixmap = QPixmap(size()); >+ m_pixmap = QPixmap(size() * dpr); >+ m_pixmap.setDevicePixelRatio(dpr); > > QPainter p(&m_pixmap); > p.fillRect(rect(), m_pOptions->m_bgColor);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 723436
:
639720
| 639722