effects/colorpicker: Factor out effects->renderTargetRect() constant

This commit is contained in:
ivan tkachenko 2022-08-08 17:57:10 +03:00
parent 90688b11f6
commit 2fa4a4c4e9
No known key found for this signature in database
GPG key ID: AF72731B7C654CB3

View file

@ -54,9 +54,9 @@ void ColorPickerEffect::paintScreen(int mask, const QRegion &region, ScreenPaint
{
effects->paintScreen(mask, region, data);
if (m_scheduledPosition != QPoint(-1, -1) && effects->renderTargetRect().contains(m_scheduledPosition)) {
const QRect geo = effects->renderTargetRect();
if (m_scheduledPosition != QPoint(-1, -1) && geo.contains(m_scheduledPosition)) {
uint8_t data[4];
const QRect geo = effects->renderTargetRect();
const QPoint screenPosition(m_scheduledPosition.x() - geo.x(), m_scheduledPosition.y() - geo.y());
const QPoint texturePosition(screenPosition.x() * effects->renderTargetScale(), (geo.height() - screenPosition.y()) * effects->renderTargetScale());