math.geometry and math.geometry.rect: Fix some problems with the methods
parent
d937e03e1a
commit
f2a33f0a24
|
@ -4,5 +4,8 @@ IN: math.geometry
|
|||
GENERIC: width ( object -- width )
|
||||
GENERIC: height ( object -- width )
|
||||
|
||||
GENERIC# set-width! 1 ( object width -- object )
|
||||
GENERIC# set-height! 1 ( object height -- object )
|
||||
|
||||
GENERIC# set-x! 1 ( object x -- object )
|
||||
GENERIC# set-y! 1 ( object y -- object )
|
|
@ -45,5 +45,8 @@ M: array rect-dim drop { 0 0 } ;
|
|||
M: rect width ( rect -- width ) dim>> first ;
|
||||
M: rect height ( rect -- height ) dim>> second ;
|
||||
|
||||
M: rect set-width! ( rect width -- rect ) over dim>> set-first ;
|
||||
M: rect set-height! ( rect height -- rect ) over dim>> set-second ;
|
||||
|
||||
M: rect set-x! ( rect x -- rect ) over loc>> set-first ;
|
||||
M: rect set-y! ( rect y -- rect ) over loc>> set-second ;
|
||||
|
|
Loading…
Reference in New Issue