Page 1 of 1

Setting a clip region to a palette brush fails

Posted: Fri May 02, 2025 3:57 pm
by jPV
I'm trying to find a work-around for some other palette issue, and found this one, which looks like a bug for me. I can't see any mentions in the documentation that SetClipRegion() shouldn't work when SelectBrush() is a palette brush.

Code: Select all

; Setting a clip region to an RGB brush works
CreateBrush(1, 400, 300)
SelectBrush(1)
CreateClipRegion(1, #BOX, 0, 0, 320, 240)
SetClipRegion(1)
Box(1, 1, 350, 250, #BLUE)
EndSelect()
DisplayBrush(1, 0, 0)

Wait(100)
Cls

; Setting a clip region to a palette brush doesn't work
CreateBrush(2, 400, 300, {Palette=#PALETTE_GRAY8})
SelectBrush(2)
CreateClipRegion(2, #BOX, 0, 0, 320, 240)
SetClipRegion(2) ; Wrong usage/parameters for this command! Why? Bug?
Box(1, 1, 350, 250, #BLUE)
EndSelect()
DisplayBrush(2, 0, 0)

WaitLeftMouse()

Re: Setting a clip region to a palette brush fails

Posted: Sun May 04, 2025 5:08 pm
by airsoftsoftwair
Yup, clearly a bug, will be fixed.

Re: Setting a clip region to a palette brush fails

Posted: Sun May 11, 2025 7:21 pm
by airsoftsoftwair

Code: Select all

- Fix: SetClipRegion() fail when the current output device was a palette brush