Elements detect when children are hovered over
This commit is contained in:
parent
e3af067972
commit
031c61146b
33 changed files with 153 additions and 185 deletions
|
|
@ -82,7 +82,7 @@ template <typename T> void ColorPicker<T>::clay_draw(SkCanvas* canvas, UpdateInp
|
|||
canvas->restore();
|
||||
}
|
||||
|
||||
template <typename T> void ColorPicker<T>::input_mouse_button_callback(const InputManager::MouseButtonCallbackArgs& button, bool mouseHovering) {
|
||||
template <typename T> void ColorPicker<T>::input_mouse_button_callback(const InputManager::MouseButtonCallbackArgs& button) {
|
||||
held = HeldBar::NONE;
|
||||
if(mouseHovering && button.button == InputManager::MouseButton::LEFT && button.down && boundingBox.has_value()) {
|
||||
auto& bb = boundingBox.value();
|
||||
|
|
@ -103,12 +103,10 @@ template <typename T> void ColorPicker<T>::input_mouse_button_callback(const Inp
|
|||
}
|
||||
}
|
||||
update_color_picker_pos(button.pos);
|
||||
Element::input_mouse_button_callback(button, mouseHovering);
|
||||
}
|
||||
|
||||
template <typename T> void ColorPicker<T>::input_mouse_motion_callback(const InputManager::MouseMotionCallbackArgs& motion, bool mouseHovering) {
|
||||
template <typename T> void ColorPicker<T>::input_mouse_motion_callback(const InputManager::MouseMotionCallbackArgs& motion) {
|
||||
update_color_picker_pos(motion.pos);
|
||||
Element::input_mouse_motion_callback(motion, mouseHovering);
|
||||
}
|
||||
|
||||
template <typename T> void ColorPicker<T>::update_color_picker_pos(const Vector2f& p) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue