Skip to content

Commit

Permalink
Consider window margin when setting position
Browse files Browse the repository at this point in the history
  • Loading branch information
jwarlander authored and not-fl3 committed Dec 22, 2023
1 parent d8e2f9d commit 617b2c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,8 @@ impl Window {

pub fn set_position(&mut self, position: Vec2) {
self.position = position;
self.cursor.area.x = position.x;
self.cursor.area.y = position.y + self.title_height;
self.cursor.area.x = position.x + self.window_margin.left;
self.cursor.area.y = position.y + self.title_height + self.window_margin.top;
}

pub fn title_rect(&self) -> Rect {
Expand Down

0 comments on commit 617b2c8

Please sign in to comment.