From d72548644ee6eea38ac9b32faa32c9de6e9a9a7c Mon Sep 17 00:00:00 2001 From: Quentin Leonetti Date: Sun, 14 Jul 2019 08:58:51 +0200 Subject: [PATCH] fix async draw and update pixels example --- desktop/sources/scripts/library.js | 4 ++-- examples/pixels.lisp | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/desktop/sources/scripts/library.js b/desktop/sources/scripts/library.js index d75b601..b532ec4 100644 --- a/desktop/sources/scripts/library.js +++ b/desktop/sources/scripts/library.js @@ -15,8 +15,8 @@ function Library (ronin) { return path } - this.draw = (path, rect) => { - ronin.surface.draw(path, rect) + this.draw = (path, rect, callback) => { + ronin.surface.draw(path, rect, callback) return rect } diff --git a/examples/pixels.lisp b/examples/pixels.lisp index 91ec4a4..f599c38 100644 --- a/examples/pixels.lisp +++ b/examples/pixels.lisp @@ -4,6 +4,7 @@ ; Draw photo - (draw "../../PREVIEW.jpg") - (echo (select (rect 0 0 10 10))) -) \ No newline at end of file + (draw "../../PREVIEW.jpg" + (frame) + (lambda () (echo (select (rect 660 344 10 10)))) +)) \ No newline at end of file