rawpython / remi

Python REMote Interface library. Platform independent. In about 100 Kbytes, perfect for your diet.
Apache License 2.0
3.48k stars 401 forks source link

fix TabBox title size calculation #478

Closed ulda closed 2 years ago

ulda commented 2 years ago

Hi I used remi and made a TabBox with 7 tabs. This makes a wired display, the last tab gets into a second line of tab titles. I found out that this is due to rounding errors when calculating the width to 0.1% Below is a fix to always calculate the with to be near but less 100.0%. For Eye-Candy, the last tab will then be set slightly wider to fill up the rounding error.

And maybe you can also remove the debug print with the second hunk.

dddomodossola commented 2 years ago

Thank you a lot @ulda

dddomodossola commented 1 year ago

@ulda I had to review your code. Just to inform you that the code were prone to a double division by 0 exception. Furthermore there were the possibility to an unassigned variable exception for the last tab sizing. I however thank you for the cooperation. Kind Regards, Davide