From 566326ea17b9fdb909f285ff630a46ca90a01815 Mon Sep 17 00:00:00 2001 From: Abhijith Date: Thu, 17 Nov 2016 10:14:12 -0800 Subject: [PATCH] Fixing scrollimage for calliope --- libs/core/images.cpp | 7 ++----- libs/core/shims.d.ts | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/libs/core/images.cpp b/libs/core/images.cpp index ec93716d..40cb014b 100644 --- a/libs/core/images.cpp +++ b/libs/core/images.cpp @@ -61,7 +61,7 @@ namespace ImageMethods { /** * Scrolls an image . - * @param frameOffset x offset moved on each animation step, eg: 5, 1, -1 + * @param frameOffset x offset moved on each animation step, eg: 1, 2, 5 * @param interval time between each animation step in milli seconds, eg: 200 */ //% help=images/show-image weight=79 async blockNamespace=images @@ -69,10 +69,7 @@ namespace ImageMethods { //% parts="ledmatrix" void scrollImage(Image id, int frameOffset, int interval) { MicroBitImage i(id); - if (i.getWidth() <= 5) - showImage(id, 0); - else - uBit.display.animate(i, interval, frameOffset, 0); + uBit.display.animate(i, interval, frameOffset, MICROBIT_DISPLAY_WIDTH - 1); } diff --git a/libs/core/shims.d.ts b/libs/core/shims.d.ts index 5a9fea3a..b9349e0d 100644 --- a/libs/core/shims.d.ts +++ b/libs/core/shims.d.ts @@ -53,7 +53,7 @@ declare interface Image { /** * Scrolls an image . - * @param frameOffset x offset moved on each animation step, eg: 5, 1, -1 + * @param frameOffset x offset moved on each animation step, eg: 1, 2, 5 * @param interval time between each animation step in milli seconds, eg: 200 */ //% help=images/show-image weight=79 async blockNamespace=images