UIElement.contains

Check if given point is considered in the widget, for clicks, mouse moves, etc. This function is meant to be overridden.

It is meant for widgets that aren't rectangles, and is relatively rare in practice.

It can be useful to disambiguate clicks and mouse-over between widgets that would otherwise overlap (you can also use Z-order to solve that).

class UIElement
nothrow @nogc
bool
contains
(
int x
,
int y
)

Return Value

Type: bool

true if point (x, y) is inside widget.

Note: This is unusual, but it seems a widget could be clickable beyond its .position(). It won't be able to draw there, though. So it's advised to not exceed _position.

Meta