NamseEnt / namseent

Mono Repository for Namse Entertainment Ltd.
GNU Affero General Public License v3.0
13 stars 2 forks source link

[Bug]: Wrong mouse position on wheel event #970

Closed bigfoodK closed 1 month ago

bigfoodK commented 1 month ago

Expected Behavior

Event::Wheel should have same xy as other mouse events

Actual Behavior

Wrong xy returns

Steps to Reproduce

        ctx.add(
            simple_rect(
                Wh::single(100.px()),
                Color::TRANSPARENT,
                0.px(),
                Color::BLACK,
            )
            .attach_event(|event| {
                let Event::Wheel { event } = event else {
                    return;
                };
                let local_xy = event.local_xy();
                namui::log!(">>>>>>>>> xy: {local_xy:?}");
            }),
        );

Animation

[WASI stdout(tid: 15)] >>>>>>>>> xy: Xy { x: Px(0.0), y: Px(8704.0) }
[WASI stdout(tid: 15)] >>>>>>>>> xy: Xy { x: Px(0.0), y: Px(13312.0) }
[WASI stdout(tid: 15)] >>>>>>>>> xy: Xy { x: Px(0.0), y: Px(19712.0) }
[WASI stdout(tid: 15)] >>>>>>>>> xy: Xy { x: Px(0.0), y: Px(38144.0) }
[WASI stdout(tid: 15)] >>>>>>>>> xy: Xy { x: Px(0.0), y: Px(59392.0) }
[WASI stdout(tid: 15)] >>>>>>>>> xy: Xy { x: Px(1.0), y: Px(6400.0) }
[WASI stdout(tid: 15)] >>>>>>>>> xy: Xy { x: Px(1.0), y: Px(10496.0) }
[WASI stdout(tid: 15)] >>>>>>>>> xy: Xy { x: Px(1.0), y: Px(14848.0) }

Other Info

Other mouse events are fine