mirror of
https://github.com/FliegendeWurst/cursive.git
synced 2024-11-27 11:16:03 +00:00
Fix focus state in linear layout
This commit is contained in:
parent
df11b4f1f0
commit
4fff7882aa
@ -110,8 +110,8 @@ impl View for LinearLayout {
|
|||||||
fn draw(&mut self, printer: &Printer) {
|
fn draw(&mut self, printer: &Printer) {
|
||||||
// Use pre-computed sizes
|
// Use pre-computed sizes
|
||||||
let mut offset = Vec2::zero();
|
let mut offset = Vec2::zero();
|
||||||
for child in self.children.iter_mut() {
|
for (i,child) in self.children.iter_mut().enumerate() {
|
||||||
child.view.draw(&printer.sub_printer(offset, child.size, true));
|
child.view.draw(&printer.sub_printer(offset, child.size, i == self.focus));
|
||||||
|
|
||||||
*self.orientation.get_ref(&mut offset) += self.orientation.get(&child.size);
|
*self.orientation.get_ref(&mut offset) += self.orientation.get(&child.size);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user