docs: clarify layout example dependency and occurrence contracts
This commit is contained in:
@@ -20,6 +20,7 @@ class CircleTarget: RectBlock {
|
||||
// 圆内点击递增自身计数并停止向祖先传播;父容器不会为同一次点击再递增。
|
||||
function onEvent(self: CircleTarget, event: Event): Unit {
|
||||
// 此示例的点击分发选中圆后调用对象方法;stopPropagation 只阻止后续祖先组,不撤销已经执行的捕获处理。
|
||||
// 此覆盖没有按 event.kind 过滤;若从源码派发其他事件,同样会递增 hits 并停止其后续祖先传播。
|
||||
self.hits.increment()
|
||||
event.stopPropagation()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user