Make ui::spawn(selector) accept floating-point position directly
This commit is contained in:
parent
55d2a48ff2
commit
a6b89e3d54
2 changed files with 3 additions and 3 deletions
|
|
@ -56,6 +56,6 @@ namespace psemek::ui
|
|||
std::function<void(std::size_t)> callback_;
|
||||
};
|
||||
|
||||
bool spawn(element * root, std::shared_ptr<selector> selector, geom::point<int, 2> const & position, std::function<void(std::size_t)> on_selected);
|
||||
bool spawn(element * root, std::shared_ptr<selector> selector, geom::point<float, 2> const & position, std::function<void(std::size_t)> on_selected);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -166,7 +166,7 @@ namespace psemek::ui
|
|||
callback_ = std::move(callback);
|
||||
}
|
||||
|
||||
bool spawn(element * root, std::shared_ptr<selector> selector, geom::point<int, 2> const & position, std::function<void(std::size_t)> on_selected)
|
||||
bool spawn(element * root, std::shared_ptr<selector> selector, geom::point<float, 2> const & position, std::function<void(std::size_t)> on_selected)
|
||||
{
|
||||
ui::screen * screen = find_last_parent_of_type<struct screen>(root);
|
||||
if (!screen)
|
||||
|
|
@ -212,7 +212,7 @@ namespace psemek::ui
|
|||
});
|
||||
|
||||
send_fake_mouse_move_event(event_interceptor.get(), true);
|
||||
positioner->set_position(geom::cast<float>(position), positioner::x_align::left, positioner::y_align::top);
|
||||
positioner->set_position(position, positioner::x_align::left, positioner::y_align::top);
|
||||
screen->add_child(event_interceptor, screen::x_policy::fill, screen::y_policy::fill);
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue