Fix layout computation

pull/3/head
Florian Dehau 8 years ago
parent c862fa9ce3
commit d8d18d3d9d

@ -202,22 +202,22 @@ pub fn split(area: &Rect, dir: &Direction, margin: u16, sizes: &[Size]) -> Vec<R
let value = value as u16; let value = value as u16;
match attr { match attr {
0 => { 0 => {
if value <= area.width { if value <= dest_area.right() {
results[index].x = value; results[index].x = value;
} }
} }
1 => { 1 => {
if value <= area.height { if value <= dest_area.bottom() {
results[index].y = value; results[index].y = value;
} }
} }
2 => { 2 => {
if value <= area.width { if value <= dest_area.width {
results[index].width = value; results[index].width = value;
} }
} }
3 => { 3 => {
if value <= area.height { if value <= dest_area.height {
results[index].height = value; results[index].height = value;
} }
} }

Loading…
Cancel
Save