23 const int64_t dx = delta.x, dy = delta.y;
24 return dx * dx + dy * dy >= int64_t(distance) * distance;
The frame's element tree.
Definition gui_element_storage.h:100
Definition gui_logging.h:24
An input event delivered to an element's EventHandler.
Definition gui_input_handler_func.h:20
A 64-bit element ID whose bit layout depends on its IDMode.
Definition gui_id.h:23
static constexpr ID Invalid()
The "no element" ID (all bits zero); also the default for optional ID parameters.
Definition gui_id.h:66
One press on an element that may become a drag.
Definition gui_pointer_drag.h:41
Ended
How a press ended.
Definition gui_pointer_drag.h:67
int2 pressScreen
pointer at the press, screen pixels
Definition gui_pointer_drag.h:44
bool Press(const ElementEvent &e, const ElementStorage &storage, MouseButtons button=MouseButtons::Left, bool atOnce=false)
Starts tracking e when it is button going down: true then.
bool IsDragging(ID element) const noexcept
A press of element is held and has become a drag.
Definition gui_pointer_drag.h:53
MouseButtons button
the button held
Definition gui_pointer_drag.h:43
int2 ScreenDelta(const InputState &s) const noexcept
Pointer travel since the press, in screen pixels.
Definition gui_pointer_drag.h:81
void Reset() noexcept
Drops any press.
Definition gui_pointer_drag.h:78
bool IsHeld() const noexcept
A press is held, on any element.
Definition gui_pointer_drag.h:49
bool Cancel(ID element) noexcept
Drops the press of element (Escape, a lost capture): true when there was one.
bool IsPressed(ID element) const noexcept
A press of element is held.
Definition gui_pointer_drag.h:51
int2 LocalDelta(const ElementEvent &e, const ElementStorage &storage) const
Pointer travel since the press, in the space of the element's rect (follows zoom).
Ended Release(const ElementEvent &e)
For the held button coming up on e.id: how the press ended. There is no press after.
bool Move(const ElementEvent &e, int32_t distance)
For a move of the held press: true when it is a drag move, the one that goes past distance pixels (se...
int2 pressLocal
pointer at the press, in the space of the element's rect
Definition gui_pointer_drag.h:45
bool dragging
moved the drag distance (or a drag from the press on)
Definition gui_pointer_drag.h:46
Integer 2D vector.
Definition gui_base_types.h:19