A row scrolled out of its list is not on the screen, so no test may click it
CI found the gap the hard way: with every kind of asset in the project the new scene sits below the panel, and the right click for "Set as start scene" landed somewhere under the list instead of on the row. locate() only asked whether a text was visible, and a masked row still is - it is merely clipped away. locateAll and overlayTexts now walk the tree together (eachText) and carry the clip of every ancestor, measured on the widget that owns the mask: Pixi v8 hands a Graphics set as a mask to the mask effect and reports empty bounds for it, so asking the mask itself declares every masked text in the editor missing. Two hooks with two notions of "visible" was the second half of the same bug. The panel also scrolls the selected row into view now, the way the hierarchy has always done - an asset selected elsewhere has to be findable in the list, test or no test. And step 21 learned that scene is a property kind.
This commit is contained in:
1 parent
1e9d21cd5d
commit
150f2e0906
4 files changed
+76
-22
No files matched your search
@@ -116,7 +116,14 @@ export class AssetPanel extends Panel {
|
||||
|
||||
private syncSelection(): void {
|
||||
const s = this.state.selection;
|
||||
this.list.select(s?.kind === 'asset' ? s.assetId : null, true);
|
||||
const id = s?.kind === 'asset' ? s.assetId : null;
|
||||
this.list.select(id, true);
|
||||
// A selection made anywhere else – a graph node, a picker, a fresh asset – has to be reachable
|
||||
// in the list, and with fifteen kinds of asset in a project the row is often below the fold.
|
||||
if (id) {
|
||||
const index = this.state.project.assets.findIndex((a) => a.id === id);
|
||||
if (index >= 0) this.scroll.ensureVisible(index * this.list.rowHeight, this.list.rowHeight);
|
||||
}
|
||||
}
|
||||
|
||||
private createAsset(type: AssetType, name = ASSET_TYPE_LABELS[type], props: PropertyBag = {}): void {
|
||||
|
||||
Reference in new issue
Block a user