summaryrefslogtreecommitdiff
path: root/anim/src/theme.zig
diff options
context:
space:
mode:
Diffstat (limited to 'anim/src/theme.zig')
-rw-r--r--anim/src/theme.zig43
1 files changed, 39 insertions, 4 deletions
diff --git a/anim/src/theme.zig b/anim/src/theme.zig
index a96d79c..846014f 100644
--- a/anim/src/theme.zig
+++ b/anim/src/theme.zig
@@ -497,8 +497,6 @@ pub const metric = struct {
pub const mnemonic = 180;
pub const operands = 264;
pub const annotation = 564;
- pub const operand_chars = 24;
- pub const annotation_chars = 25;
};
/// `bytes`: a hexdump row, from its panel's left edge (the band's right half).
@@ -563,6 +561,18 @@ pub const metric = struct {
pub const arrow_head = [2]f32{ 12, 10 };
};
+ /// `calls`, full size: a disc 48 across, levels 46 apart, the root's
+ /// centre 48 under the tag; the result's square of 30 on the shoulder,
+ /// 12 right of the centre and 42 up; the caller's box 64 by 28.
+ pub const calls = struct {
+ pub const radius = 24;
+ pub const level = 46;
+ pub const root = 48;
+ pub const badge = 30;
+ pub const badge_at = [2]f32{ 12, 42 };
+ pub const caller = [2]f32{ 64, 28 };
+ };
+
/// A lens's lanes: projections 4 under its tag, links 8 above its bottom edge.
pub const lens = struct {
pub const top_lane = 4;
@@ -749,6 +759,9 @@ pub const time = struct {
/// A flow's arrow outlives the landing by this.
pub const linger = 1.0;
};
+ /// A `continue`'s registers strike in a wave, this far apart in
+ /// pwndbg's order (the fill in over `strike.in`, no arm, no pulse).
+ pub const continue_wave = 2.0 / 60.0;
/// The veil that dims everything but the subject.
pub const veil = 0.30;
/// A telescope extends: the links after one that changed are followed
@@ -778,10 +791,32 @@ pub const time = struct {
pub const far = 0.50;
pub const out = 0.30;
};
+ /// `travel`, for a pin: it sets off `after` the strike that moved it;
+ /// in a drawing it takes `node` to the next node or cell, `nodes` to
+ /// one farther; in the stack's lane `row` to the next row and
+ /// `step_per_row` a further row, `row_max` at most. One that comes
+ /// fades in (`in`, rising 8), one that goes fades out (`out`); a name
+ /// joining or leaving a pin cross-fades (`names`).
+ pub const pin = struct {
+ pub const after = 0.30;
+ pub const node = 0.50;
+ pub const nodes = 0.60;
+ pub const row = 0.40;
+ pub const step_per_row = 2.0 / 60.0;
+ pub const row_max = 0.60;
+ pub const in = 0.20;
+ pub const out = 0.20;
+ pub const names = 0.20;
+ };
+ /// A return in the calls tree: its frame leaves the backtrace as the
+ /// idea strikes, and the result on the node's shoulder this long after.
+ pub const badge_after = 0.20;
/// `establish`, for a lens: its elements come in from this far into the opening.
pub const establish_rise = 0.50;
- /// `relayout`: a change of split.
+ /// `relayout`: a change of split; the drawing fades out before the
+ /// move (`relayout_fade`) and in after it.
pub const relayout = 0.80;
+ pub const relayout_fade = 0.20;
/// A caption leaves, then nothing, then the next arrives rising this
/// many units; never typed out, never crossfaded. The stage stays
/// still `caption_lead` after it (`caption_lead_first` after a scene's
@@ -949,7 +984,7 @@ test "easing runs from 0 to 1 without turning back" {
test "durations are whole frames" {
const t = time;
- for ([_]f32{ t.snap, t.quick, t.step, t.step_per_row, t.step_max, t.move, t.travel, t.layout, t.camera, t.camera_far, t.fire, t.cascade, t.read_value, t.read_more, t.rest, t.strike.arm, t.strike.in, t.strike.pulse, t.strike.hold, t.strike.cool, t.strike.out, t.read.out, t.current_jump, t.flight.lift, t.flight.near, t.flight.second, t.veil, t.link.after, t.link.pin_out, t.link.in, t.link.in_far, t.link.settle, t.link.out, t.project.bracket, t.project.draw, t.project.out, t.establish_rise, t.relayout, t.caption_in, t.caption_out, t.caption_gap, t.walk, t.run, t.sprint, t.phrase_rest, t.before_cut }) |d| {
+ for ([_]f32{ t.snap, t.quick, t.step, t.step_per_row, t.step_max, t.move, t.travel, t.layout, t.camera, t.camera_far, t.fire, t.cascade, t.read_value, t.read_more, t.rest, t.strike.arm, t.strike.in, t.strike.pulse, t.strike.hold, t.strike.cool, t.strike.out, t.read.out, t.current_jump, t.flight.lift, t.flight.near, t.flight.second, t.veil, t.link.after, t.link.pin_out, t.link.in, t.link.in_far, t.link.settle, t.link.out, t.project.bracket, t.project.draw, t.project.out, t.establish_rise, t.relayout, t.relayout_fade, t.continue_wave, t.badge_after, t.pin.after, t.pin.node, t.pin.nodes, t.pin.row, t.pin.step_per_row, t.pin.row_max, t.pin.in, t.pin.out, t.pin.names, t.caption_in, t.caption_out, t.caption_gap, t.walk, t.run, t.sprint, t.phrase_rest, t.before_cut }) |d| {
const frames = d * t.fps;
try expect(@abs(frames - @round(frames)) < 1e-3);
}