Fixes graphics.drawEllipse.
It failed because a Natural cannot be negative but drawEllipse tried to set negative values to a Natural variable; this variable's type was changed to an Int.
This commit is contained in:
parent
e33af13ae3
commit
c5c6ef6e2b
1 changed files with 4 additions and 1 deletions
|
|
@ -360,7 +360,7 @@ proc drawEllipse*(sur: PSurface, CX, CY, XRadius, YRadius: Natural,
|
||||||
## of the ellipse.
|
## of the ellipse.
|
||||||
var
|
var
|
||||||
X, Y: Natural
|
X, Y: Natural
|
||||||
XChange, YChange: Natural
|
XChange, YChange: Int
|
||||||
EllipseError: Natural
|
EllipseError: Natural
|
||||||
TwoASquare, TwoBSquare: Natural
|
TwoASquare, TwoBSquare: Natural
|
||||||
StoppingX, StoppingY: Natural
|
StoppingX, StoppingY: Natural
|
||||||
|
|
@ -501,6 +501,7 @@ if sdl_ttf.Init() < 0: raiseEGraphics()
|
||||||
|
|
||||||
when isMainModule:
|
when isMainModule:
|
||||||
var surf = newScreenSurface(800, 600)
|
var surf = newScreenSurface(800, 600)
|
||||||
|
|
||||||
surf.fillSurface(colWhite)
|
surf.fillSurface(colWhite)
|
||||||
|
|
||||||
# Draw the shapes
|
# Draw the shapes
|
||||||
|
|
@ -545,6 +546,8 @@ when isMainModule:
|
||||||
if evk.keysym.sym == SDL.K_LEFT:
|
if evk.keysym.sym == SDL.K_LEFT:
|
||||||
surf.drawHorLine(395, 300, 50, colBlack)
|
surf.drawHorLine(395, 300, 50, colBlack)
|
||||||
echo("Drawing")
|
echo("Drawing")
|
||||||
|
elif evk.keysym.sym == SDL.K_ESCAPE:
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
echo(evk.keysym.sym)
|
echo(evk.keysym.sym)
|
||||||
of SDL.MOUSEBUTTONDOWN:
|
of SDL.MOUSEBUTTONDOWN:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue