mirror of
https://github.com/niri-wm/niri.git
synced 2026-06-23 02:05:33 +07:00
layout: Extract col variable
This commit is contained in:
@@ -2116,26 +2116,24 @@ impl<W: LayoutElement> ScrollingSpace<W> {
|
|||||||
error!("insert hint column index is out of range");
|
error!("insert hint column index is out of range");
|
||||||
return None;
|
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");
|
error!("insert hint tile index is out of range");
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
let (height, y) = if tile_index == 0 {
|
let (height, y) = if tile_index == 0 {
|
||||||
(150., self.columns[column_index].tile_offset(tile_index).y)
|
(150., col.tile_offset(tile_index).y)
|
||||||
} else if tile_index == self.columns[column_index].tiles.len() {
|
} else if tile_index == col.tiles.len() {
|
||||||
(
|
(
|
||||||
150.,
|
150.,
|
||||||
self.columns[column_index].tile_offset(tile_index).y
|
col.tile_offset(tile_index).y - self.options.gaps - 150.,
|
||||||
- self.options.gaps
|
|
||||||
- 150.,
|
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
(
|
(
|
||||||
300.,
|
300.,
|
||||||
self.columns[column_index].tile_offset(tile_index).y
|
col.tile_offset(tile_index).y - self.options.gaps / 2. - 150.,
|
||||||
- self.options.gaps / 2.
|
|
||||||
- 150.,
|
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user