struct

Phosphor::Zone

Inherits Struct < Value < Object

A named, hit-testable rectangular region registered during render.

View#register_zone records one of these per interactive region a widget wants to receive TouchEvents for; View#zone_at finds which zone (if any) a touch coordinate falls inside. See View's own doc comment for how zones are cleared and rebuilt each frame.

widget_id is the mount id of the widget that registered this zone — View#dispatch_touch falls back to delivering the touch to this widget when id itself doesn't match any mounted widget, which is how a widget can register named sub-region zones (e.g. "action_apply") without a separate mounted widget per zone.

Constructors

new(id : String, widget_id : Symbol, x : Int32, y : Int32, width : Int32, height : Int32)
Source

Instance methods

contains?(px : Int32, py : Int32) : Bool

Returns true if (px, py) falls within this zone's bounds.

Source
height
Source
widget_id
Source
width
Source