Fix focus state in linear layout

This commit is contained in:
Alexandre Bury 2015-06-08 15:47:09 -07:00
parent df11b4f1f0
commit 4fff7882aa

View File

@ -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);
} }