Commit 2a0a710f authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

apply patch #91583 from MAik Qualmann

CCBUGS: 345168
parent a0ea6361
......@@ -1270,7 +1270,7 @@ static inline int normalizeAndClamp(int norm, int sum, int max)
DColor DImg::getSubPixelColor(float x, float y) const
{
if (isNull() || x < 0 || y < 0 || x >= width() || y >= height())
if (isNull())
{
return DColor();
}
......@@ -1282,6 +1282,9 @@ DColor DImg::getSubPixelColor(float x, float y) const
return DColor();
}
x = qBound(0.0f, x, (float)width() - 1);
y = qBound(0.0f, y, (float)height() - 1);
Digikam::DColor col(0, 0, 0, 0xFFFF, sixteenBit());
#ifdef LANCZOS_DATA_FLOAT
......@@ -1386,15 +1389,13 @@ DColor DImg::getSubPixelColor(float x, float y) const
DColor DImg::getSubPixelColorFast(float x, float y) const
{
if (x < 0)
if (isNull())
{
x = 0;
return DColor();
}
if (y < 0)
{
y = 0;
}
x = qBound(0.0f, x, (float)width() - 1);
y = qBound(0.0f, y, (float)height() - 1);
int xx = (int)x;
int yy = (int)y;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment