Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odd Shifting of Display on Ubuntu #238

Open
Mercerenies opened this issue Nov 10, 2018 · 3 comments
Open

Odd Shifting of Display on Ubuntu #238

Mercerenies opened this issue Nov 10, 2018 · 3 comments

Comments

@Mercerenies
Copy link

Any attempt to draw shapes onto a basic window seems to have an odd coordinate system, centered halfway down the window on the left. Specifically, when I run this code on my machine.

extern crate piston_window;

use piston_window::*;

fn main() {
    let dims = (640.0, 480.0);
    let mut window: PistonWindow =
        WindowSettings::new("Hello, Piston!", (dims.0 as u32, dims.1 as u32))
            .exit_on_esc(true)
            .build()
            .unwrap();
    while let Some(e) = window.next() {
        match e {
            Event::Loop(Loop::Render(_)) => {
                window.draw_2d(&e, |c, g| {
                    clear([1.0; 4], g);
                    rectangle(
                        [1.0, 0.0, 0.0, 1.0],
                        [0.0, 0.0, dims.0, dims.1],
                        c.transform,
                        g,
                    );
                });
            }
            _ => {}
        }
    }
}

which should, in theory, draw a red rectangle the size of the window, instead draws a rectangle in only a portion of the lower-left quadrant of the window.

piston_window 0.84.0 on Ubuntu 16.04, using Rust 1.29.2. Downgrading to piston_window 0.64.0 resolves the problem, and other users. I initially posted this on StackOverflow, in case that thread has any useful information in it.

@Aethelflaed
Copy link

Tried with piston_window 0.81, 0.84 and 0.89 using Rust 1.34.1 on archlinux and didn't have any problem.

@Alphare
Copy link

Alphare commented Jun 2, 2019

I have the same issue on Debian running i3wm. Downgrading to 0.64.0 seems to fix the issue.

@Oozolz
Copy link

Oozolz commented Jun 25, 2019

I think its a wayland issue, had a similar problem (not rendering like 1 cm ontop of the window) on wayland, after i rebooted on Xorg it was fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants