Skip to content

Commit

Permalink
Update the window float position when resized
Browse files Browse the repository at this point in the history
Floating windows with bottom or right anchors need to be repositioned
when they are resized.
  • Loading branch information
fredizzimo committed Mar 5, 2023
1 parent e483bf1 commit 1558b30
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/editor/mod.rs
Expand Up @@ -236,6 +236,21 @@ impl Editor {
fn resize_window(&mut self, grid: u64, width: u64, height: u64) {
if let Some(window) = self.windows.get_mut(&grid) {
window.resize((width, height));
if let Some(anchor_info) = &window.anchor_info {
let anchor_grid_id = anchor_info.anchor_grid_id;
let anchor_type = anchor_info.anchor_type.clone();
let anchor_left = anchor_info.anchor_left;
let anchor_top = anchor_info.anchor_top;
let sort_order = Some(anchor_info.sort_order);
self.set_window_float_position(
grid,
anchor_grid_id,
anchor_type,
anchor_left,
anchor_top,
sort_order,
)
}
} else {
let window = Window::new(
grid,
Expand Down

0 comments on commit 1558b30

Please sign in to comment.