aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasaya Tojo <masaya@tojo.tokyo>2021-05-15 00:05:53 +0900
committerMasaya Tojo <masaya@tojo.tokyo>2021-05-15 00:05:53 +0900
commit563df85b8773c353043349c555f7622ddc1cab14 (patch)
treeda7d1b2baa031d5d75ef9e681c8d26dc74944e41
parent47650cd5814c4b2cd31bc0e5ca3e0d053dd0c423 (diff)
Fix `draw-line` procedure.
* sicp-picture-language.scm(draw-line): Fix.
-rw-r--r--sicp-picture-language.scm15
1 files changed, 6 insertions, 9 deletions
diff --git a/sicp-picture-language.scm b/sicp-picture-language.scm
index 39f9c8e..379aa0e 100644
--- a/sicp-picture-language.scm
+++ b/sicp-picture-language.scm
@@ -122,15 +122,12 @@
(($ <vect> x1 y1)
(match end-vect
(($ <vect> x2 y2)
- (let* ((screen (current-screen))
- (w (pict-width screen))
- (h (pict-height screen)))
- (current-screen
- (lb-superimpose
- (line (* w x1) (- h (* h y1))
- (* w x2) (- h (* h y2))
- #:stroke-width (current-line-stroke-width)
- #:color (current-line-color))))))))))
+ (let ((screen (current-screen)))
+ (let ((l (line x1 y1
+ x2 y2
+ #:stroke-width (current-line-stroke-width)
+ #:color (current-line-color))))
+ (current-screen (pin-over screen 0 0 l)))))))))
(define current-screen (make-parameter #f))
(define current-pict-ids (make-parameter '()))