graphics: draw(Ver|Hor)Line
This commit is contained in:
parent
8f41312ca6
commit
eb727862e3
1 changed files with 2 additions and 2 deletions
|
|
@ -264,7 +264,7 @@ proc drawHorLine*(sur: PSurface, x, y, w: Natural, Color: TColor) =
|
||||||
var pitch = sur.s.pitch div ColSize
|
var pitch = sur.s.pitch div ColSize
|
||||||
|
|
||||||
if y >= 0 and y <= sur.s.h:
|
if y >= 0 and y <= sur.s.h:
|
||||||
for i in 0 .. min(sur.s.w-x, w-1)-1:
|
for i in 0 .. min(sur.s.w-x, w)-1:
|
||||||
setPix(video, pitch, x + i, y, color)
|
setPix(video, pitch, x + i, y, color)
|
||||||
|
|
||||||
proc drawVerLine*(sur: PSurface, x, y, h: Natural, Color: TColor) =
|
proc drawVerLine*(sur: PSurface, x, y, h: Natural, Color: TColor) =
|
||||||
|
|
@ -273,7 +273,7 @@ proc drawVerLine*(sur: PSurface, x, y, h: Natural, Color: TColor) =
|
||||||
var pitch = sur.s.pitch div ColSize
|
var pitch = sur.s.pitch div ColSize
|
||||||
|
|
||||||
if x >= 0 and x <= sur.s.w:
|
if x >= 0 and x <= sur.s.w:
|
||||||
for i in 0 .. min(sur.s.h-y, h-1)-1:
|
for i in 0 .. min(sur.s.h-y, h)-1:
|
||||||
setPix(video, pitch, x, y + i, color)
|
setPix(video, pitch, x, y + i, color)
|
||||||
|
|
||||||
proc fillCircle*(s: PSurface, p: TPoint, r: Natural, color: TColor) =
|
proc fillCircle*(s: PSurface, p: TPoint, r: Natural, color: TColor) =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue