math.geometry and math.geometry.rect: Fix some problems with the methods

db4
Eduardo Cavazos 2008-07-21 17:01:44 -05:00
parent d937e03e1a
commit f2a33f0a24
2 changed files with 6 additions and 0 deletions

View File

@ -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 )

View File

@ -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 ;