DigiScore / neoscore

A python library for notating music in a graphics-first paradigm
https://neoscore.org
BSD 3-Clause "New" or "Revised" License
108 stars 9 forks source link

Fix pen width padding in bounding/clipping rects #62

Closed ajyoon closed 2 years ago

ajyoon commented 2 years ago

The key problem was that the QClippingPath's padding was set from the pen value before the pen was set, so it was always using the default pen width even when the drawn path had a different pen. The solution was to simply defer the padding calculation to occur within update_geometry().

This change also fixes a few other related issues:

Fixes #14 thanks to help from @Xavman42

ajyoon commented 2 years ago

@Xavman42 github won't let me assign a review to you, but if you'd like to take a look over this before I merge I'd appreciate a sanity check!

ajyoon commented 2 years ago

A very thick straight line:

thickness_2

Your example:

thickness

Xavman42 commented 2 years ago

This looks like a big improvement to me! I wonder if this is related to the flowable clipping issues in #21. Consider this approved!

ajyoon commented 2 years ago

Those problems are definitely related, but I don't expect this to fix them. thanks!