Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Buckettool fill bugs #1772

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
UX: No matter what, allow a fill the very first time
It's been a growing annoyance of mine that sometimes a fill won't happen, sometimes caused by a bug, other times because of the rules with are to be applied when filling while dragging the mouse.
  • Loading branch information
MrStevns committed Jul 10, 2023
commit 64b8c90e5c4439e9e09bc45c26a8b3c3182c4338
4 changes: 4 additions & 0 deletions core_lib/src/graphics/bitmap/bitmapbucket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ bool BitmapBucket::allowFill(const QPoint& checkPoint) const
return false;
}

if (!mFilledOnce) {
return true;
}
return BitmapImage::compareColor(colorOfReferenceImage, mStartReferenceColor, mTolerance, mPixelCache) &&
(targetPixelColor == 0 || BitmapImage::compareColor(targetPixelColor, mStartReferenceColor, mTolerance, mPixelCache));
}
Expand Down Expand Up @@ -155,6 +158,7 @@ void BitmapBucket::paint(const QPointF updatedPoint, std::function<void(BucketSt
delete replaceImage;

state(BucketState::DidFillTarget, mTargetFillToLayerIndex, currentFrameIndex);
mFilledOnce = true;
}

BitmapImage BitmapBucket::flattenBitmapLayersToImage()
Expand Down
1 change: 1 addition & 0 deletions core_lib/src/graphics/bitmap/bitmapbucket.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ class BitmapBucket
int mTolerance = 0;

int mTargetFillToLayerIndex = -1;
int mFilledOnce = false;

Properties mProperties;
};
Expand Down