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

wayland: consider base in resize increment calculation #4866

Merged
merged 1 commit into from
Jan 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions window/src/os/wayland/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -672,14 +672,11 @@ impl WaylandWindowInner {
if let Some(incr) = self.resize_increments {
let min_width = incr.base_width + incr.x;
let min_height = incr.base_height + incr.y;
let desired_pixel_width = max(
pixel_width - (pixel_width % incr.x as i32),
min_width as i32,
);
let desired_pixel_height = max(
pixel_height - (pixel_height % incr.y as i32),
min_height as i32,
);
let extra_width = (pixel_width - incr.base_width as i32) % incr.x as i32;
let extra_height = (pixel_height - incr.base_height as i32) % incr.y as i32;
let desired_pixel_width = max(pixel_width - extra_width, min_width as i32);
let desired_pixel_height =
max(pixel_height - extra_height, min_height as i32);
w = self.pixels_to_surface(desired_pixel_width) as u32;
h = self.pixels_to_surface(desired_pixel_height) as u32;
pixel_width = self.surface_to_pixels(w.try_into().unwrap());
Expand Down
Loading