2nd Pass Render

This commit is contained in:
2026-08-05 16:21:17 -04:00
parent 2f96dd3da5
commit 67524206fb
23 changed files with 251 additions and 89 deletions
+7 -7
View File
@@ -174,9 +174,9 @@ static void testHitToggleAndTail() {
L.tail.y + L.tail.height / 2, L) == FooterHit::Tail);
// The count label is a passive readout — never a hit target.
CHECK(hitTestFooterBar(L.count.x + L.count.width / 2,
L.count.y + L.count.height / 2, L) == FooterHit::None);
L.count.y + L.count.height / 2, L) == FooterHit::Invalid);
// Between the toggle and the count (the gap) is a clean miss.
CHECK(hitTestFooterBar(L.toggle.x + L.toggle.width, L.toggle.y, L) == FooterHit::None);
CHECK(hitTestFooterBar(L.toggle.x + L.toggle.width, L.toggle.y, L) == FooterHit::Invalid);
}
// Half-open bounds: far edges excluded; points outside every box miss.
@@ -184,12 +184,12 @@ static void testHitEdgesAndOutside() {
const FooterBarSpec s = roundSpec();
FooterRect f{0, 100, 700, 26};
const FooterBarLayout L = computeFooterBar(f, s);
CHECK(hitTestFooterBar(L.toggle.x - 1, L.toggle.y, L) == FooterHit::None);
CHECK(hitTestFooterBar(L.tail.x + L.tail.width, L.tail.y, L) == FooterHit::None); // right edge excl
CHECK(hitTestFooterBar(L.toggle.x, L.toggle.y - 1, L) == FooterHit::None); // above
CHECK(hitTestFooterBar(L.toggle.x, L.toggle.y + L.toggle.height, L) == FooterHit::None); // below excl
CHECK(hitTestFooterBar(L.toggle.x - 1, L.toggle.y, L) == FooterHit::Invalid);
CHECK(hitTestFooterBar(L.tail.x + L.tail.width, L.tail.y, L) == FooterHit::Invalid); // right edge excl
CHECK(hitTestFooterBar(L.toggle.x, L.toggle.y - 1, L) == FooterHit::Invalid); // above
CHECK(hitTestFooterBar(L.toggle.x, L.toggle.y + L.toggle.height, L) == FooterHit::Invalid); // below excl
// Far right (the prune/version region) is not this module's — a clean None here.
CHECK(hitTestFooterBar(f.x + f.width - 10, L.toggle.y, L) == FooterHit::None);
CHECK(hitTestFooterBar(f.x + f.width - 10, L.toggle.y, L) == FooterHit::Invalid);
}
// A suppressed box claims no point — a Tail hit-test where the Tail was dropped is None.
+3 -2
View File
@@ -106,12 +106,13 @@ static void testDefaultSettingIsOff() {
CHECK(s.mode == TailMode::None);
CHECK(s.manualMs == kDefaultManualTailMs);
CHECK(tailToggleLabel(s) == "Tail: Off");
CHECK(s.secondPass == false);
}
// --- serialize/deserialize: per-project persistence round-trip ----------------
static bool settingsEqual(const TailSetting& a, const TailSetting& b) {
return a.mode == b.mode && a.manualMs == b.manualMs;
return a.mode == b.mode && a.manualMs == b.manualMs && a.secondPass == b.secondPass;
}
static void testRoundTripNoneDefault() {
@@ -142,7 +143,7 @@ static void testSerializeByteIdentity() {
// and re-serializing a round-tripped setting must be byte-identical — the blob
// lives in the .rpp, so a byte shift would dirty every saved project.
TailSetting s; // None + 2000.0 default
CHECK(serializeTailSetting(s) == "{\"mode\":0,\"manualMs\":2000}");
CHECK(serializeTailSetting(s) == "{\"mode\":0,\"manualMs\":2000,\"secondPass\":false}");
TailSetting man; man.mode = TailMode::Manual; man.manualMs = 3141.592653589793;
const std::string json = serializeTailSetting(man);
auto back = deserializeTailSetting(json);