Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
issue-1864: Fix fill misbehaving when drawing was partly outside border
Browse files Browse the repository at this point in the history
MrStevns committed Jul 23, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent eba8d6d commit 4c78d3f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions core_lib/src/graphics/bitmap/bitmapimage.cpp
Original file line number Diff line number Diff line change
@@ -880,8 +880,7 @@ bool* BitmapImage::floodFillPoints(const BitmapImage* targetImage,
{
QRgb oldColor = targetImage->constScanLine(point.x(), point.y());
oldColor = qRgba(qRed(oldColor), qGreen(oldColor), qBlue(oldColor), qAlpha(oldColor));
QRect borderBounds = searchBounds.intersected(maxBounds);
searchBounds = searchBounds.adjusted(-1, -1, 1, 1).intersected(maxBounds);
searchBounds = searchBounds.adjusted(-1, -1, 1, 1).united(maxBounds);

// Preparations
QList<QPoint> queue; // queue all the pixels of the filled area (as they are found)
@@ -921,7 +920,7 @@ bool* BitmapImage::floodFillPoints(const BitmapImage* targetImage,
int yCoord = point.y() - maxBounds.top();

// In case we fill outside the searchBounds, expand the search area to the max.
if (!borderBounds.contains(point)) {
if (!searchBounds.contains(point)) {
checkOutside = true;
}

0 comments on commit 4c78d3f

Please sign in to comment.