Merge 0.8.3 upstream
This commit is contained in:
@@ -24,11 +24,8 @@ inline qreal getColorLuma(const QColor& c)
|
||||
|
||||
bool ColorUtils::colorIsDark(const QColor& c)
|
||||
{
|
||||
bool isWhite = false;
|
||||
if (getColorLuma(c) <= 0.60) {
|
||||
isWhite = true;
|
||||
}
|
||||
return isWhite;
|
||||
// when luma <= 0.5, we considor it as a dark color
|
||||
return getColorLuma(c) <= 0.5;
|
||||
}
|
||||
|
||||
QColor ColorUtils::contrastColor(const QColor& c)
|
||||
|
||||
@@ -90,7 +90,10 @@ QPixmap ScreenGrabber::grabEntireDesktop(bool& ok)
|
||||
|
||||
QRect geometry;
|
||||
for (QScreen* const screen : QGuiApplication::screens()) {
|
||||
geometry = geometry.united(screen->geometry());
|
||||
QRect scrRect = screen->geometry();
|
||||
scrRect.moveTo(scrRect.x() / screen->devicePixelRatio(),
|
||||
scrRect.y() / screen->devicePixelRatio());
|
||||
geometry = geometry.united(scrRect);
|
||||
}
|
||||
|
||||
QPixmap p(QApplication::primaryScreen()->grabWindow(
|
||||
|
||||
Reference in New Issue
Block a user