docs: clarify layout bounds and retained image text flow

This commit is contained in:
2026-11-12 20:41:16 +08:00
parent 0c4bd06231
commit 45b0b53d4f
6 changed files with 21 additions and 2 deletions
+2
View File
@@ -45,6 +45,8 @@ impl Rect {
/// 用闭区间比较判断点是否命中,左右上下边缘都计入;调用前需将点转换到矩形所在空间。
pub fn contains(self, point: Point) -> bool {
// 闭区间四边比较;自身不处理裁剪叠加、圆角或世界面板遮挡,这些属于更上层命中流程。
// 相邻矩形共享边缘时两者都可命中,Frame/工具命中调用方按绘制顺序选目标;这里不负责消除重叠。
// 零宽/零高矩形也可能命中其线段/端点;要求正面积的裁剪或视口调用方必须另外判断尺寸。
point.x >= self.x
&& point.x <= self.x + self.width
&& point.y >= self.y