Skip to content

Commit

Permalink
fix code fmg
Browse files Browse the repository at this point in the history
  • Loading branch information
raphamorim committed Jul 20, 2023
1 parent 86cbb9a commit 509d88b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions rio/src/screen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,13 @@ impl Screen {
#[inline]
pub fn mouse_position(&self, display_offset: usize) -> Pos {
let layout = &self.sugarloaf.layout;
let line_fac = ((layout.sugarheight) * self.sugarloaf.layout.scale_factor) as usize;
let line_fac =
((layout.sugarheight) * self.sugarloaf.layout.scale_factor) as usize;
let col_fac = (layout.sugarwidth * self.sugarloaf.layout.scale_factor) as usize;

let col = self.mouse.x.saturating_sub((layout.padding.x * self.sugarloaf.layout.scale_factor) as usize) / col_fac;
let col = self.mouse.x.saturating_sub(
(layout.padding.x * self.sugarloaf.layout.scale_factor) as usize,
) / col_fac;
let col = std::cmp::min(Column(col), Column(layout.columns));

let line = self.mouse.y.saturating_sub(
Expand Down

0 comments on commit 509d88b

Please sign in to comment.