epsilon-sample-app-rust icon indicating copy to clipboard operation
epsilon-sample-app-rust copied to clipboard

can't draw rectangles with more than 65637 pixels on Epsilon 18.2.0?

Open LoucaFrss opened this issue 2 years ago • 0 comments

Hello, I was trying to display an image on the whole calculator screen, but strange things happened, sometimes the numworks crashed, other times I couldn't restart the app because "exam mode was enabled" (I never enabled it), so I tried to figure out where this bug came from and found that if I tried to draw a rectangle with push_rect(rect: Rect, pixels: &[Color]) with more than 65637 white pixels (which is very close to 2^16) , the calculator was crashing, the same thing with more pixels with random colors created weird things like enabling the exam mode or crash when starting other applications. here is the code:

#[no_mangle]
pub fn main() {
    push_rect(
        Rect {
            x: 0,
            y: 0,
            width: 10,
            height: 10,
        },
        &[Color { rgb565: u16::MAX }; 65637],
    );
}

(The only things I changed other than this are adding #[derive(Clone, Copy) to Color and the build.rs and .cargo/config files)

I don't know much about how numworks works, but I found this bug quite weird and I didn't see any issue about it on the different numworks github repositories is this normal? is there a fix?

LoucaFrss avatar May 28 '23 09:05 LoucaFrss