Fix plot to use immutable constructors.
This commit is contained in:
parent
8db45eb557
commit
86a976531c
|
@ -71,21 +71,15 @@
|
||||||
;; Returns an immutable instance of color%. Immutable colors are faster because they don't have to
|
;; Returns an immutable instance of color%. Immutable colors are faster because they don't have to
|
||||||
;; have immutable copies made when they're used in a dc.
|
;; have immutable copies made when they're used in a dc.
|
||||||
(define (make-color% r g b)
|
(define (make-color% r g b)
|
||||||
(define color (make-object color% r g b))
|
(make-immutable-color r g b))
|
||||||
(send color set-immutable)
|
|
||||||
color)
|
|
||||||
|
|
||||||
;; Returns an immutable instance of pen%. Same reasoning as for make-color%.
|
;; Returns an immutable instance of pen%. Same reasoning as for make-color%.
|
||||||
(define (make-pen% r g b w s)
|
(define (make-pen% r g b w s)
|
||||||
(define pen (make-object pen% (make-color% r g b) w s))
|
(make-immutable-pen (make-color% r g b) w s))
|
||||||
(send pen set-immutable)
|
|
||||||
pen)
|
|
||||||
|
|
||||||
;; Returns an immutable instance of brush%. Same reasoning as for make-color%.
|
;; Returns an immutable instance of brush%. Same reasoning as for make-color%.
|
||||||
(define (make-brush% r g b s)
|
(define (make-brush% r g b s)
|
||||||
(define brush (make-object brush% (make-color% r g b) s))
|
(make-immutable-brush (make-color% r g b) s))
|
||||||
(send brush set-immutable)
|
|
||||||
brush)
|
|
||||||
|
|
||||||
(define (color%? c) (is-a? c color%))
|
(define (color%? c) (is-a? c color%))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user