mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-18 01:02:23 +00:00
Main brings the reviewed one-time-control and timeline-mark changes. They keep this branch's renderer work: earthquakes draw through the draw port and register their strong quakes as marks; the weather clock keeps `follows` beside `world`; the weather layer measures ages and delays from the timeline time; the Visual panel keeps its sky and weather groups under Effects. Tests that moved time through the weather clock now move it on the world clock.
This commit is contained in:
commit
0ecbfbecd0
123 files changed
+5917
-1471
No files matched your search
@@ -19,6 +19,8 @@ import {
|
||||
SCOPE_TERMINUS_MAX_PCT,
|
||||
SCOPE_FEATHER_RATIO_DEFAULT,
|
||||
getScopeMaskFeather,
|
||||
setScopeMaskOpacity,
|
||||
getScopeMaskOpacity,
|
||||
SCOPE_OUTSIDE_ALPHA,
|
||||
SCOPE_TERMINUS_ALPHA_NEAR,
|
||||
SCOPE_TERMINUS_FAR_M,
|
||||
@@ -206,6 +208,37 @@ test('scope appearance follows direct state changes and install/destroy lifecycl
|
||||
}
|
||||
});
|
||||
|
||||
test('scope opacity fades the painted mask without repainting it', () => {
|
||||
const dom = stubScopeMaskDom();
|
||||
try {
|
||||
assert.equal(getScopeMaskOpacity(), 1, 'full by default');
|
||||
setScopeMaskOpacity(0.4);
|
||||
installScopeMask({ container: dom.container });
|
||||
assert.equal(dom.canvas.style.opacity, '0.4', 'a choice made before install applies');
|
||||
const paints = { ...dom.ops };
|
||||
const terminus = getScopeTerminusAlpha();
|
||||
setScopeMaskOpacity(0.25);
|
||||
assert.equal(dom.canvas.style.opacity, '0.25');
|
||||
assert.deepEqual(dom.ops, paints, 'the mask is not repainted');
|
||||
assert.equal(getScopeTerminusAlpha(), terminus, 'the terminus is its own setting');
|
||||
setScopeMaskOpacity(3);
|
||||
assert.equal(getScopeMaskOpacity(), 1);
|
||||
setScopeMaskOpacity(-1);
|
||||
assert.equal(getScopeMaskOpacity(), 0);
|
||||
setScopeMaskOpacity('soft');
|
||||
assert.equal(getScopeMaskOpacity(), 1, 'not a number is full');
|
||||
setScopeMaskOpacity(0.5);
|
||||
destroyScopeMask();
|
||||
installScopeMask({ container: dom.container });
|
||||
assert.equal(dom.canvas.style.opacity, '0.5', 'reinstall keeps it');
|
||||
_resetScopeMaskForTest();
|
||||
assert.equal(getScopeMaskOpacity(), 1, 'test reset restores full');
|
||||
} finally {
|
||||
destroyScopeMask();
|
||||
dom.restore();
|
||||
}
|
||||
});
|
||||
|
||||
test('a DPR change with no resize still repaints the backing store', () => {
|
||||
const dom = stubScopeMaskDom({ width: 1000, height: 800, dpr: 1 });
|
||||
try {
|
||||
|
||||
Reference in new issue
Block a user