From b5f832b0b2c61eb630e4ac52f7f9acce3b3d8a61 Mon Sep 17 00:00:00 2001 From: David Schmenk Date: Fri, 27 Dec 2019 19:01:01 -0800 Subject: [PATCH] Fix simple line plot routine --- src/libsrc/lines.pla | 10 +++++----- src/samplesrc/hgrtest.pla | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/libsrc/lines.pla b/src/libsrc/lines.pla index ce2f256..d2fbc3c 100644 --- a/src/libsrc/lines.pla +++ b/src/libsrc/lines.pla @@ -261,10 +261,10 @@ export def line(x1, y1, x2, y2)#0 fin err = dy2 - dx2 / 2 for x = x1 to x2 - plot(x, y) + plot(x, y1)#0 if err >= 0 err = err - dx2 - y = y + sy + y1 = y1 + sy fin err = err + dy2 next @@ -276,14 +276,14 @@ export def line(x1, y1, x2, y2)#0 fin err = dx2 - dy2 / 2 for y = y1 to y2 - plot(x, y) + plot(x1, y)#0 if err >= 0 err = err - dy2 - x = x + sx + x1 = x1 + sx fin err = err + dx2 next - fin + fin end // diff --git a/src/samplesrc/hgrtest.pla b/src/samplesrc/hgrtest.pla index 168365c..1083c25 100644 --- a/src/samplesrc/hgrtest.pla +++ b/src/samplesrc/hgrtest.pla @@ -20,12 +20,15 @@ def testline#0 var i setlinespans(@hgrHlin, @hgrVlin) + setlineplot(@hgrXorPlot) hgrColor(7) for i = 0 to 191 step 8 linespans(0, i, 279, 191 - i) + //line(0, i, 279, 191 - i) next for i = 0 to 279 step 9 linespans(i, 0, 279 - i, 191) + //line(i, 0, 279 - i, 191) next end def testblt(sprtnum)#0