diff options
author | Stijn Buys <ingar@telenet.be> | 2020-07-17 23:08:03 +0200 |
---|---|---|
committer | Stijn Buys <ingar@telenet.be> | 2020-07-17 23:08:03 +0200 |
commit | 094ac735e16ad94c12bc1d866253f1c1d84a9af6 (patch) | |
tree | a056ddd8a71f5259b3afd4098a24a0ad7019f9d0 /src/ui/ui.cc | |
parent | 6521936cdaa2132ee6860dfda335d0afbe958484 (diff) |
Added Widget::tooltip() support. Minor cleanups.
Diffstat (limited to 'src/ui/ui.cc')
-rw-r--r-- | src/ui/ui.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ui/ui.cc b/src/ui/ui.cc index 0877519..700099e 100644 --- a/src/ui/ui.cc +++ b/src/ui/ui.cc @@ -266,7 +266,7 @@ void UI::frame() Widget *f = 0; if (!mouse_buttonleft_pressed) { - f = find_mouse_focus(mouse_cursor); + f = find_widget_in_location(mouse_cursor); } else { f = find_visible_child(ui_mouse_focus); } @@ -306,7 +306,7 @@ bool UI::input_mouse_button(const bool pressed, unsigned int button) } // set mouse focus - Widget *f = find_mouse_focus(mouse_cursor); + Widget *f = find_widget_in_location(mouse_cursor); if (f) { f->event_mouse(mouse_cursor); @@ -326,7 +326,7 @@ bool UI::input_mouse_wheel(const math::Vector2f & direction) bool handled = false; // set mouse focus - Widget *f = find_mouse_focus(mouse_cursor); + Widget *f = find_widget_in_location(mouse_cursor); if (f) { f->event_mouse(mouse_cursor); @@ -399,8 +399,8 @@ void UI::draw_pointer() gl::push(); gl::translate(mouse_cursor.x(), mouse_cursor.y(), 0); - float angle = core::application()->time() * 0.75f - floorf(core::application()->time() * 0.75f); - angle *= 360.0f; + const float t = core::application()->time() * 0.75f; + const float angle = (t - floorf(t)) * 360.0f; gl::rotate(angle, math::Vector3f(0, 0, 1.0f)); gl::translate(-mouse_cursor.x(), -mouse_cursor.y(), 0); } |