docs(canvas): explain binding input subscriptions and hit queries
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
/**
|
||||
* 原生节点视口裁剪的最小几何判断,不读取文档或维护渲染状态。
|
||||
*/
|
||||
import type {Rect} from '../canvas-core/geometry.ts';
|
||||
/** Positive-area native node visibility. Degenerate nodes are retained for measurement. */
|
||||
/** 正面积矩形要求与视口有正面积交叠,只有边界接触不算可见。
|
||||
* 宽/高非正的退化节点保留,让 renderer 有机会测量它,而不是提前裁掉。 */
|
||||
export function nativeRectVisible(node:Rect,viewport:Rect){if(node.width<=0||node.height<=0)return true;return Math.min(node.x+node.width,viewport.x+viewport.width)>Math.max(node.x,viewport.x)&&Math.min(node.y+node.height,viewport.y+viewport.height)>Math.max(node.y,viewport.y);}
|
||||
|
||||
Reference in New Issue
Block a user