Bitmap/Bresenham's line algorithm: Difference between revisions
m
→{{header|PureBasic}}: small optimization
({{header|PureBasic}}: Added PureBasic) |
m (→{{header|PureBasic}}: small optimization) |
||
Line 874:
<lang PureBasic>Procedure BresenhamLine(x0 ,y0 ,x1 ,y1)
If Abs(y1 - y0) > Abs(x1 - x0);
steep =
EndIf
If x0 > x1
Line 894 ⟶ 892:
EndIf
For x = x0 To x1
If steep
Plot(y,x)
Else
Plot(x,y)
EndIf
error - deltay
If error < 0
|