summaryrefslogtreecommitdiff
path: root/anim/src/stage.zig
diff options
context:
space:
mode:
Diffstat (limited to 'anim/src/stage.zig')
-rw-r--r--anim/src/stage.zig4
1 files changed, 3 insertions, 1 deletions
diff --git a/anim/src/stage.zig b/anim/src/stage.zig
index 35988aa..a03c8bd 100644
--- a/anim/src/stage.zig
+++ b/anim/src/stage.zig
@@ -29,6 +29,8 @@ pub const Stage = struct {
hold_free: anim.Value,
/// 0 to 1 as the window goes from where it was to where it is held (and back).
hold_in: anim.Value,
+ /// The registers panel's rows (the scene's, `layout.fit`): every split it changes to keeps them. 0: as the split has it.
+ registers_rows: f32 = 0,
const Move = struct { from: Split, to: Split, p: anim.Value };
@@ -45,7 +47,7 @@ pub const Stage = struct {
/// A change of split: every panel glides to its place in `to`.
pub fn relayout(st: *Stage, s: *anim.Frame, to: Split) void {
const p = s.value(0);
- st.moves[st.count] = .{ .from = st.last(), .to = to, .p = p };
+ st.moves[st.count] = .{ .from = st.last(), .to = if (st.registers_rows > 0) theme.layout.fit(to, st.registers_rows) else to, .p = p };
st.count += 1;
// The drawing fades out (12 f), the panels move, it fades in at its new size.
s.play(.{st.drawing.to(0)}, .{ .seconds = theme.time.relayout_fade, .ease = anim.ease.linear });