Reveal stacked windows on both axes
Authored by
mfwolffe <wolffemf@dukes.jmu.edu>
- SHA
c38fcff0c1909c8f7f494e81b5fa1dbae808743b- Parents
-
92e1d14 - Tree
fd7792d
c38fcff
c38fcff0c1909c8f7f494e81b5fa1dbae808743b92e1d14
fd7792d| Status | File | + | - |
|---|---|---|---|
| M |
tarmac/src/core/tree.rs
|
5 | 3 |
tarmac/src/core/tree.rsmodified@@ -61,7 +61,8 @@ impl Rect { | ||
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | -const STACK_REVEAL_OFFSET: f64 = 24.0; | |
| 64 | +const STACK_REVEAL_OFFSET_X: f64 = 24.0; | |
| 65 | +const STACK_REVEAL_OFFSET_Y: f64 = 24.0; | |
| 65 | 66 | |
| 66 | 67 | #[derive(Debug, Clone, PartialEq)] |
| 67 | 68 | pub enum Node { |
@@ -321,8 +322,8 @@ impl Node { | ||
| 321 | 322 | geoms.push(( |
| 322 | 323 | *wid, |
| 323 | 324 | Rect::new( |
| 324 | - padded.x + STACK_REVEAL_OFFSET * depth as f64, | |
| 325 | - padded.y, | |
| 325 | + padded.x + STACK_REVEAL_OFFSET_X * depth as f64, | |
| 326 | + padded.y + STACK_REVEAL_OFFSET_Y * depth as f64, | |
| 326 | 327 | padded.width, |
| 327 | 328 | padded.height, |
| 328 | 329 | ), |
@@ -1421,6 +1422,7 @@ mod tests { | ||
| 1421 | 1422 | let g3 = geoms.iter().find(|(wid, _)| *wid == 3).unwrap().1; |
| 1422 | 1423 | |
| 1423 | 1424 | assert!(g2.x > g3.x); |
| 1425 | + assert!(g2.y > g3.y); | |
| 1424 | 1426 | assert_eq!(g2.width, g3.width); |
| 1425 | 1427 | assert_eq!(g2.height, g3.height); |
| 1426 | 1428 | } |