[Gambas-user] Overflow Errors with Gambas 3.18 and Master

Claus Dietrich claus.dietrich at freenet.de
Sat Jan 14 11:54:19 CET 2023


Am 14.01.23 um 00:20 schrieb Benoit Minisini:
> ClockFaceColor + 16777216 * ClockFaceOpacity -> This is the code that 
> overflows.
>
> You must replace this wrong code by:
>
> Color.SetAlpha(ClockFaceColor, ...) 

Thanks for the advise - will be changed.

However, the code line
Paint.Brush = Paint.Color(ClockFaceColor + 16777216 * ClockFaceOpacity)
which used to work until 3.17.3 generates a color value from &H00nnnnnn 
to &HFFnnnnnn which is within the range of colors which are allowed. 
Since 3.18 the same calculation now causes an overflow error for any 
alpha component (first 2 digits) above &H7Fnnnnnn. But , when I use the 
command
Paint.Brush = Paint.Color(&H80404040)
no error occurs.

This means that the applicable color range is still the same and the 
error is caused by the calculated value. What is wrong since 3.18 to 
calculate the color as done so far? I am asking this because some of my 
apps will be affected by this.

Best regards

Claus



More information about the User mailing list