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 =1#True
EndIf Swap x0, y0
If steep = 1Swap x1, y1
Swap x0, y0
Swap x1, y1
EndIf
If x0 > x1
Line 894 ⟶ 892:
EndIf
For x = x0 To x1
If steep = 1
Plot(y,x)
Else
Plot(x,y)
EndIf
error - deltay
If error < 0
49

edits