-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Description
Hi there,
I'm using the latest version of piston_window
(0.117.0) on linux (updated arch), and I'm having this weird issue where images I render using the code below are all *1.5 zoomed. I can get it to kinda work with something hacky along the lines of c.transform.zoom(0.667)
but it's weird + the scaling isn't perfect and I get bad aliasing.
use piston_window::*;
use std::path::Path;
fn main() {
let mut window: PistonWindow = WindowSettings::new("foo", (640, 480))
.exit_on_esc(true)
.build()
.unwrap();
let mut ctx = window.create_texture_context();
let mask = Texture::from_path(
&mut ctx,
Path::new("assets/foo.png"),
Flip::None,
&TextureSettings::new(),
)
.unwrap();
while let Some(e) = window.next() {
match e {
Event::Loop(Loop::Render(_)) => {
window.draw_2d(&e, |c, g, d| {
clear(color::hex("4d4d4d"), g);
image(&mask, c.transform, g);
ctx.encoder.flush(d);
});
}
_ => {}
}
}
}
Metadata
Metadata
Assignees
Labels
No labels