Xiaolin Wu's line algorithm: Difference between revisions
→{{header|ObjectIcon}}
Line 2,317:
=={{header|ObjectIcon}}==
The program puts up a window. In the window you can draw a line by left-mouse-button-
Rather than vary the color as such, I vary the opacity.
Line 2,330:
local width, height
local done, w, event
local x1, y1, x2, y2, press_is_active
width := 640
Line 2,340:
set_canvas("normal") | stop(&why)
press_is_active := &no
done := &no
while /done do
Line 2,351 ⟶ 2,352:
Mouse.LEFT_PRESS:
{
x1 := event[2]; y1 := event[3]
{
x2 := event[2]; y2 := event[3]
draw_line (w, x1, y1, x2, y2)
press_is_active := &no
}
}
}
|