SETPIXEL doesn't work in PENREVERSE mode
A Logo programming environment for Microsoft Windows
Brought to you by:
david_costanzo
As discussed at [8151276b], there is a bug in SETPIXEL where it reverses the pixel instead of using the given color when in PENREVERSE mode, or shortly after switching back into PENPAINT mode (but before moving). The bug does not exist in MSWLogo, so it's a regression in FMSLogo
To reproduce:
px fd 1 cs setpixel 2 zoom 4
What happens:
You zoom in on a black dot
Expected Result:
You zoom in on a blue dot
I have commited a fix for this bug. It will be available in FMSLogo 7.0.0.
I have confirmed that this is a regression that I introduced in FMSLogo 6.16.0 (released in August 2007). The bug went nearly 9 years without anyone reporting it.
The bug was introduced when I committed a major performace improvement in drawing routine by re-using the same screen and memory device context across all command calls, instead of creating new ones in each call. The problem was that the foreground mix mode could be set in the device context and persist from one call (such as FORWARD) to another (such as SETPIXEL) without SETPIXEL realizing it. This fix, which was suggested in [8151276b] is to make SETPIXEL set the mix mode on the device contexts before calling the win32 ::SetPixel() function, so that it doesn't matter what any previous call had set it to.
Related
Discussion: 8151276b