diff options
| author | Ivan Molodetskikh <yalterz@gmail.com> | 2025-02-06 10:15:43 +0300 |
|---|---|---|
| committer | Ivan Molodetskikh <yalterz@gmail.com> | 2025-02-06 10:30:03 +0300 |
| commit | b31c0359ebce114ae2f9b4e5df3dc37a93f5115e (patch) | |
| tree | f39194b5801fd88c964f03136a4b2d03a69050b6 /src/layout | |
| parent | 934e5a60335bf6abe606c02c887c78c14e312645 (diff) | |
| download | niri-b31c0359ebce114ae2f9b4e5df3dc37a93f5115e.tar.gz niri-b31c0359ebce114ae2f9b4e5df3dc37a93f5115e.tar.bz2 niri-b31c0359ebce114ae2f9b4e5df3dc37a93f5115e.zip | |
layout: Extract col variable
Diffstat (limited to 'src/layout')
| -rw-r--r-- | src/layout/scrolling.rs | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/src/layout/scrolling.rs b/src/layout/scrolling.rs index 3153ed0c..66fb8e65 100644 --- a/src/layout/scrolling.rs +++ b/src/layout/scrolling.rs @@ -2116,26 +2116,24 @@ impl<W: LayoutElement> ScrollingSpace<W> { error!("insert hint column index is out of range"); return None; } - if tile_index > self.columns[column_index].tiles.len() { + + let col = &self.columns[column_index]; + if tile_index > col.tiles.len() { error!("insert hint tile index is out of range"); return None; } let (height, y) = if tile_index == 0 { - (150., self.columns[column_index].tile_offset(tile_index).y) - } else if tile_index == self.columns[column_index].tiles.len() { + (150., col.tile_offset(tile_index).y) + } else if tile_index == col.tiles.len() { ( 150., - self.columns[column_index].tile_offset(tile_index).y - - self.options.gaps - - 150., + col.tile_offset(tile_index).y - self.options.gaps - 150., ) } else { ( 300., - self.columns[column_index].tile_offset(tile_index).y - - self.options.gaps / 2. - - 150., + col.tile_offset(tile_index).y - self.options.gaps / 2. - 150., ) }; |
