mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2006
Posts: 4,153
W
Wims Offline OP
Hoopy frood
OP Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,153
There seems to be an off by one error when flipping bitmap with negative values in drawcopy and drawpic.

Code
//window -pdCf +lt @test -1 -1 64 64 | drawrect -fr @test 16777215 0 0 0 0 64 64 | drawrect -fr @test 255 0 16 16 16 16 | drawcopy @test 16 16 16 16 @test 48 16 -16 16
This shows a white line between the two red squares, which feels wrong.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Dec 2002
Posts: 5,428
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,428
Thanks for your bug report. The reason for this is that you are using a negative value for the width. Ideally, all of the /draw identifiers should report errors when negative values are specified, however they have worked in the same way for over twenty years, so they need to be left as they are. It just happens that when you specify negative values for width or height that these are passed directly to BitBlt(), which handles negative values in its own way. However, there may be many interim calculations and/or API calls before BitBlt() is called, none of which have specific support for negative values. So you are, in fact, depending on undefined behaviour. If you want to use negative values, you will to need to cater for the current behaviour in your script.


Link Copied to Clipboard