Cropped pixels on rotation

Posted on
  • Hello, I'm trying to draw images using the Graphics library. I have a few small scale images (11x11px) which need to be displayed in different rotations. To save bytes, I am attempting to use the rotate option, as in:
    g.drawImage(img, x, y, { rotate: Math.PI })
    The image is drawn, but the end result has a 2px wide crop at the bottom edge. Is that a bug? Btw where can I find the bug tracker of this project? I am sure someone else ran across this before but I couldn't tell
    Thanks!

  • Thanks for the links.
    That doesn't seem to be the same problem, though.
    I will try to find it and raise otherwise

  • It'd be great if you could come up with an example if you're going to file an issue. I guess you mean something like this?

    var img = {
      width : 8, height : 8, bpp : 8,
      buffer : new Uint8Array([
        3,3,3,3,3,3,3,3,
        3,3,3,3,3,3,3,3,
        3,1,1,1,1,1,1,3,
        3,1,1,1,1,1,1,3,
        3,1,1,1,1,1,1,3,
        3,1,1,1,1,1,1,3,
        3,1,1,1,1,1,1,3,
        3,3,3,3,3,3,3,3,
      ]).buffer
    };
    g.drawImage(img,4,4,{rotate:Math.PI});
    

    It definitely feels like there is some kind of issue there - seems to be missing at least the right and bottom edge...

  • Issue raised here. Thanks for the sample code btw
    https://github.com/espruino/Espruino/issues/2535

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

Cropped pixels on rotation

Posted by Avatar for arvere @arvere

Actions