Keep a grip from laying out before it has a size
The gate of a5184b3 was red: three tests in variable-rows.test.ts
failed with "document is not defined". setGrabbable laid the grip
out right away, so a row that had not been sized yet squeezed its
label to nothing. The label then measured its text, and Node has no
canvas for that.
- setGrabbable only lays out again once the grip has a width. The
first resize places the mark with the dots' inset anyway.
Tests:
- variable-rows + block-drag: 2 files, 13 tests, all green
(variable-rows was 3 failed / 5 passed before)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a5184b3368
commit
93c0a80b7d
1 file changed
+3
-1
@@ -43,7 +43,9 @@ export class Grip extends Widget {
|
||||
setGrabbable(on: boolean): void {
|
||||
if (this.grabbable === on) return;
|
||||
this.grabbable = on;
|
||||
this.layout();
|
||||
// Not laid out yet: the first resize places the mark, and squeezing it to nothing now would only
|
||||
// make its label measure itself for no use.
|
||||
if (this.w > 0) this.layout();
|
||||
this.invalidate();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user