macroquad icon indicating copy to clipboard operation
macroquad copied to clipboard

Labels cut off if drawn within a window with high_dpi: true

Open jackfranklin opened this issue 3 years ago • 0 comments

Take this code:

        root_ui().window(
            hash!(),
            Vec2::new(0.0, 0.0),
            Vec2::new(100.0, 100.0),
            |ui| {
                ui.label(None, "foo bar baz");
            },
        );

If we run this with high_dpi: false, it renders correctly. But, render with high_dpi: true and unfortunately the label gets cut off:

Screenshot from 2022-02-28 19-06-18

If I just draw a label outside of the window, it works fine:

Screenshot from 2022-02-28 19-07-40

I tried to debug this a little; commenting out this line https://github.com/not-fl3/macroquad/blob/master/src/ui/render/painter.rs#L506 in the Painter does fix it, so that would imply that the logic to determine clips might be being thrown off by the high_dpi flag somewhere and we might need to account for it. But unfortunately I've not been able to make more progress beyond that.

jackfranklin avatar Feb 28 '22 19:02 jackfranklin