fix(ui): constrain editor tools and add screen color sampling

This commit is contained in:
Codex
2026-11-14 23:37:36 +03:00
parent d7885fe098
commit 5f93defabf
13 changed files with 96 additions and 19 deletions
+12
View File
@@ -15,3 +15,15 @@ test('viewport shrink retains reachable header and fits small screens',()=>{
assert.deepEqual(v,{left:8,top:8,width:264,height:164});
assert.deepEqual(fitWindow(r,bounds),r);
});
test('custom tool minimum applies to restored geometry and every resize edge',()=>{
const minimum={width:380,height:280};
const restored=fitWindow({...r,width:320,height:200},bounds,minimum);
assert.equal(restored.width,380);assert.equal(restored.height,280);
for(const edge of windowResizeEdges)for(const delta of [-3000,3000]){
const resized=resizeWindow(r,edge,delta,delta,bounds,minimum);
assert.ok(resized.width>=380&&resized.height>=280);
}
assert.deepEqual(fitWindow(r,{width:280,height:180},minimum),{left:8,top:8,width:264,height:164});
const tiny=fitWindow(r,{width:10,height:10},minimum);assert.equal(tiny.width,1);assert.equal(tiny.height,1);
});