• I was following the example at https://www.espruino.com/Reference#l_E_s­howScroller for how to use the e.showScroller function for Bangle.js 2. I copied this code from the tutorial:

    E.showScroller({
      h : 40, c : 8,
      draw : (idx, r) => {
        g.setBgColor((idx&1)?"#fff":"#ccc").clea­rRect(r.x,r.y,r.x+r.w-1,r.y+r.h-1);
        g.setFont("6x8:2").drawString("Item Number\n"+idx,r.x+10,r.y+4);
      },
      select : (idx) => console.log("You selected ", idx)
    });
    

    It works, but the bottom number gets cuts off as you scroll. The issue is shown in the video below.
    Is there any way I can fix this?


    1 Attachment

  • Thanks - this looks like a bug in showScroller - I'm just surprised it's not affecting the other apps that use it...

  • Is there a fix yet for the bug? I am still having the issue.

  • Just checked on this and it's to do with pixel-doubled fonts and clipping rectangles. It'll need a firmware update, which I'll get on tomorrow.

    Best bet is don't use pixel-doubled fonts. On Bangle.js 2 if you use 12x20 or 6x15 or Vector it'll be ok:

    E.showScroller({
      h : 40, c : 8,
      draw : (idx, r) => {
        g.setBgColor((idx&1)?"#fff":"#ccc").clea­rRect(r.x,r.y,r.x+r.w-1,r.y+r.h-1);
        g.setFont("12x20").drawString("Item Number\n"+idx,r.x+10,r.y+2);
      },
      select : (idx) => console.log("You selected ", idx)
    });
    
  • ok, Thanks!

  • Latest firmware should be fixed now

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

e.showScroller Example From API Reference Cuts Off Some of the Text as you Scroll.

Posted by Avatar for Ronin @Ronin

Actions