Page 1 of 1

GetLayerStyle and changed color

Posted: Mon Oct 18, 2021 7:16 pm
by Flinx
Hello,

while changing the color of a TextOut layer I found a situation where GetLayerStyle did not return the changed color. If I change font size or style, then it works.

Code: Select all

@DISPLAY {Color = #GRAY, Layers = True}
name$="line"

SetFont(#SERIF, 50)
SetFontColor(#BLACK)
TextOut(#CENTER, #CENTER, "Test", {Name=name$})

DebugPrint("Color 1: ",GetLayerStyle(name$).color)
Wait(50)

SetLayerStyle(name$, {Color=#WHITE})
DebugPrint("Color 2: ",GetLayerStyle(name$).color)
Wait(50)

SetLayerStyle(name$, {Color=#WHITE, Font=#SANS})
;SetLayerStyle(name$, {Color=#WHITE, Fontsize=70})
DebugPrint("Color 3: ",GetLayerStyle(name$).color)
Wait(50)
Maybe a small bug?

Ralf

Re: GetLayerStyle and changed color

Posted: Mon Oct 18, 2021 10:24 pm
by airsoftsoftwair
Yes, looks like a bug. Will be fixed.

Re: GetLayerStyle and changed color

Posted: Tue Oct 19, 2021 11:02 am
by Flinx
Thanks.
An addition (although I think that is the same problem): Changing the text after only changing the color will cause the old color to be used again.
A snippet with two additional lines:

Code: Select all

SetLayerStyle(name$, {Color=#WHITE})
DebugPrint("Color 2: ",GetLayerStyle(name$).color)
Wait(50)

SetLayerStyle(name$, {Text="Test2"})
Wait(50)
Ralf

Re: GetLayerStyle and changed color

Posted: Wed Oct 20, 2021 4:34 pm
by airsoftsoftwair
Thanks, will check this.

Re: GetLayerStyle and changed color

Posted: Sat Oct 30, 2021 11:54 pm
by airsoftsoftwair
This was caused by the bug reported here so it's fixed now.