Commit 6713c408 authored by Gilles Caulier's avatar Gilles Caulier 🗼
Browse files

backport commit #2a0a710f from git/master

CCBUGS: 345168
parent c638dcf9
......@@ -1264,7 +1264,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();
}
......@@ -1276,6 +1276,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
......@@ -1380,15 +1383,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