GetLayerStyle and changed color

Discuss any general programming issues here
Post Reply
Flinx
Posts: 188
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

GetLayerStyle and changed color

Post 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
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: GetLayerStyle and changed color

Post by airsoftsoftwair »

Yes, looks like a bug. Will be fixed.
Flinx
Posts: 188
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Re: GetLayerStyle and changed color

Post 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
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: GetLayerStyle and changed color

Post by airsoftsoftwair »

Thanks, will check this.
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: GetLayerStyle and changed color

Post by airsoftsoftwair »

This was caused by the bug reported here so it's fixed now.
Post Reply