-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It does not work yet on Wayland. Support for that can be added using D- Bus. See kdenlive's ColorPickerWidget that uses that. Qt has a separate D-Bus module that needs to be integrated. That is outside the scope of this commit and release. Try it for next.
- Loading branch information
Showing
3 changed files
with
5 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/* | ||
* Copyright (c) 2014-2022 Meltytech, LLC | ||
* Copyright (c) 2014-2024 Meltytech, LLC | ||
* Inspiration: KDENLIVE colorpickerwidget.cpp by Till Theato ([email protected]) | ||
* Inspiration: QColorDialog.cpp | ||
* | ||
|
@@ -48,7 +48,7 @@ void ColorPickerItem::grabColor() | |
QPixmap screenGrab = screen->grabWindow(0, m_selectedRect.x(), m_selectedRect.y(), | ||
m_selectedRect.width(), m_selectedRect.height()); | ||
QImage image = screenGrab.toImage(); | ||
int numPixel = image.width() * image.height(); | ||
int numPixel = qMax(image.width() * image.height(), 1); | ||
int sumR = 0; | ||
int sumG = 0; | ||
int sumB = 0; | ||
|