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

Fix polyline buffer not always being cleared #1822

Merged
merged 1 commit into from
Apr 17, 2024

Conversation

scribblemaniac
Copy link
Member

First reported here: https://discuss.pencil2d.org/t/problems-with-nightly-build-11-april-2024/8025

On the bitmap layer, applying a polyline path results in ScribbleArea::paintBitmapBuffer being called, which clears the mTiledBuffer. However, this function is never called when using the tool on the vector layer where the the curve is added by the tool. It will also never get cleared if clearToolData is called directly, but it seems that this function isn't currently being called outside the polyline tool. I've refactored it a bit so when clearToolData is called, the buffer is always cleared (and always after deactivating the tool so ScribbleArea::updateFrame works). One slight change is that isActiveChanged will only be triggered if mPoints is not empty, which makes sense because if it is empty, then the tool was not active and the state is not changing.

@scribblemaniac scribblemaniac added Bug Polyline Tool Vector 🔹 Minor PR (only one reviewer required) labels Apr 15, 2024
@chchwy chchwy added this to the v0.6.7 milestone Apr 16, 2024
@chchwy chchwy self-requested a review April 16, 2024 06:43
@chchwy
Copy link
Member

chchwy commented Apr 16, 2024

I can confirm the issue is fixed.

BTW, is it considered a bug that polylines turn into smooth lines when using the Smudge tool?

@scribblemaniac
Copy link
Member Author

BTW, is it considered a bug that polylines turn into smooth lines when using the Smudge tool?

Probably yes, but I would be hesitant to fix it when some of our users are currently relying on that behavior for their workflow.

@chchwy
Copy link
Member

chchwy commented Apr 17, 2024

BTW, is it considered a bug that polylines turn into smooth lines when using the Smudge tool?

Probably yes, but I would be hesitant to fix it when some of our users are currently relying on that behavior for their workflow.

Alright, I guess we are having another example of the classic software developer joke "it's not a bug, it's a feature!"
img

@chchwy chchwy merged commit 2420280 into pencil2d:master Apr 17, 2024
8 checks passed
@scribblemaniac scribblemaniac deleted the fix-vector-polyline branch April 25, 2024 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Polyline Tool 🔹 Minor PR (only one reviewer required) Vector
Projects
Development

Successfully merging this pull request may close these issues.

2 participants