Closed ssievert42 closed 1 week ago
I did some more digging:
Since fdbf0bfd2590bf241eabe3877b283a78391035ef changed the positions of a GfxDrawImageLayer
to be the value in pixels, shifted to the left by 8 bits, we need to shift the desired overlay y position by 8 bits before assigning it to the GfxDrawImageLayer
's y1
.
I did just that in #2521, and it looks like that did the trick :)
I completely forgot that overlay positions can be negative :sweat_smile: Multiplying the pixel position by 256 (which I did in #2522) is probably a lot more readable anyways.
Overlays are being cut off from the top, by about as many pixels as their y position should be, instead of landing at the desired y position.
To reproduce on a Bangle.js 2 (code copied from the docs about overlays):
Expected outcome:![good](https://github.com/espruino/Espruino/assets/113838661/84eb8478-e0b4-4417-8fb5-e7a3a42253b3)
Actual outcome:![bad](https://github.com/espruino/Espruino/assets/113838661/e7e15ea8-c7a2-48b4-9502-5ad764d4e793)
A git bisect, using the emulator, leads to this being the first bad commit: fdbf0bfd2590bf241eabe3877b283a78391035ef
Moving the following line inside the for loop above it seems to fix things https://github.com/espruino/Espruino/blob/31c5d60eb743587d9b505b5e7403eb4d8567eda1/libs/graphics/lcd_memlcd.c#L347 but that would revert part of 5a99fbdafedf5b8a551ac53f2370c76f63be9523 I've got absolutely no idea when partial updates happen, but I guess moving that iterator call inside the for loop would probably break something else ¯\_(ツ)_/¯