Skip to content

Commit

Permalink
Update the window float position when resized (neovide#1786)
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 authored and TENX-S committed Apr 11, 2023
1 parent c8f82b0 commit 173b8cd
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/editor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,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 173b8cd

Please sign in to comment.