[Oberon] Hidden bug in WMScribble.Mod?

Stefan Salewski Salewski at physnet.uni-hamburg.de
Wed Oct 19 21:41:41 CEST 2005


Hello,

some weeks ago I tried to build a simple chess board for 
Bluebottle, based on WMScribble.Mod. It was not working as 
expected by me after resizing of the window. Now, after reading 
the description of WMScribble.Mod in the thesis of F. Frey I did 
some further investigations. I have not read the complete thesis 
now, so my impression may be wrong, but for me there seems to be 
a hidden bug in WMScribble.Mod:

There is the procedure PointerDown(), which clears the window if 
the user press the right mouse button. 

PROCEDURE PointerDown(x, y : LONGINT; keys : SET);
BEGIN
lx := x; ly := y;
IF 2 IN keys THEN 
canvas.Fill(WMRectangles.MakeRect(0, 0, GetWidth(), GetHeight()), 
WMGraphics.White, WMGraphics.ModeCopy);
Invalidate(WMRectangles.MakeRect(0, 0, GetWidth(), GetHeight()))
END
END PointerDown;

If I modify it in this way, then only a quarter of the scribble 
window is cleared:  

PROCEDURE PointerDown(x, y : LONGINT; keys : SET);
BEGIN
lx := x; ly := y;
IF 2 IN keys THEN 
canvas.Fill(WMRectangles.MakeRect(0, 0, GetWidth() DIV 2, 
GetHeight() DIV 2), WMGraphics.White, WMGraphics.ModeCopy);
Invalidate(WMRectangles.MakeRect(0, 0, GetWidth(), GetHeight()))
END
END PointerDown;

But if I enlarge the window before pressing the right button to 
delete my drawing, then more than one quarter of the window is 
cleared. (This behavior leads to a corrupted display of my 
chessboard.) I think using GetWidth() and  GetHeight() in 
procedure PointerDown() is wrong -- maybe it would be correct to 
use the initial, fixed window size instead?

I am confused -- its not absolutely clear for me which procedures 
use  fixed or scaled coordinates.

The content of the window of WMScribble.Mod is scaled 
automatically, drawn lines become thicker if I enlarge the 
window. Is there a simple way to modify this, so that the window 
contents in not automatically scaled?

Maybe this will become clear if I read more of the thesis, but 
maybe someone can give me a hint now.

Some idea how to draw nice chess pieces? Currently I see only two 
methods: Using bitmap-images or drawing the pieces with simple 
drawing primitives like lines. More powerful drawing methods, as 
used by Leonardo of Native-Oberon, seems to be not available in 
Bluebottle currently.

Best regards

Stefan Salewski


More information about the Oberon mailing list