commit f483d56f5fd442c4ae030495f81d3979a82721a7 parent bfdf4abc7b3855bf18bdeb3124cbe538daec0407 Author: Virgil Dupras <hsoft@hardcoded.net> Date: Mon, 2 Jan 2023 12:34:20 -0500 pc: plugged gr/cursor to the mouse! Under the PC platform, you can try it with: f<< tests/manual/cusor.fs Diffstat:
M | fs/gr/cursor.fs | | | 5 | +++-- |
M | fs/tests/manual/cursor.fs | | | 6 | +++--- |
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/fs/gr/cursor.fs b/fs/gr/cursor.fs @@ -22,6 +22,7 @@ extends Plane struct[ Cursor dup parent>cursor ; : :move ( x y self -- ) >r \ V1=self - r@ cursor>parent r@ Rect :move r@ parent>cursor - r@ r@ parent CURSOR :copy> ; + over r@ x = over r@ y = and if 2drop rdrop else + r@ cursor>parent r@ Rect :move r@ parent>cursor + r@ r> parent CURSOR :copy> then ; ]struct diff --git a/fs/tests/manual/cursor.fs b/fs/tests/manual/cursor.fs @@ -1,6 +1,6 @@ f<< /gr/cursor.fs -screen :self Cursor :new structbind Cursor cursor screen :activate -12 12 cursor :move - +screen :self Cursor :new structbind Cursor cursor +: myloop begin mouseupdate mouse :x mouse :y cursor :move again ; +myloop