From 82b745c92bb6dab1402aef70b9c8e07a02979a41 Mon Sep 17 00:00:00 2001 From: Keith Simmons Date: Sat, 26 Jun 2021 23:17:46 -0700 Subject: [PATCH] fix pum menu positioning --- src/editor/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/editor/mod.rs b/src/editor/mod.rs index cc557a1..2f89cf5 100644 --- a/src/editor/mod.rs +++ b/src/editor/mod.rs @@ -20,7 +20,7 @@ pub use grid::CharacterGrid; pub use style::{Colors, Style}; pub use window::*; -#[derive(Clone)] +#[derive(Clone, Debug)] pub struct AnchorInfo { pub anchor_grid_id: u64, pub anchor_type: WindowAnchor, @@ -39,9 +39,9 @@ impl WindowAnchor { ) -> (f64, f64) { match self { WindowAnchor::NorthWest => (grid_left, grid_top), - WindowAnchor::NorthEast => (grid_left - width as f64, grid_top), - WindowAnchor::SouthWest => (grid_left, grid_top - height as f64), - WindowAnchor::SouthEast => (grid_left - width as f64, grid_top - height as f64), + WindowAnchor::NorthEast => (grid_left + width as f64, grid_top), + WindowAnchor::SouthWest => (grid_left, grid_top + height as f64), + WindowAnchor::SouthEast => (grid_left + width as f64, grid_top + height as f64), } } }