You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment conrod determines whether or not a point is over a widget by using its bounding-rectangle. This works fine for most widgets that come with conrod as most are the size of their bounding rectangle. This breaks down however when a widget's surface area is any other polygon. E.g. at the moment, a circular button may be pressed by clicking a corner of the button's bounding rectangle, even if that point is not on the visible button itself.
This could be fixed by adding an is_over method to the Widget trait. Arguments should include the widget's bounding Rect, &Widget::State and &Widget::Style. One issue with this approach is that the Widget type itself is not always known when attempting to pick points over widgets. E.g. we need to re-pick which point is under the mouse cursor whenever the mouse is moved. To do this, we need to be able to cast each widget's stored Widget::Style and Widget::State back to their original types, which requires knowing the Widget type itself. Unfortunately the Widget type is only known during widget instantiation. I'm not yet sure how to solve this, any input appreciated!
The text was updated successfully, but these errors were encountered:
At the moment conrod determines whether or not a point is over a widget by using its bounding-rectangle. This works fine for most widgets that come with conrod as most are the size of their bounding rectangle. This breaks down however when a widget's surface area is any other polygon. E.g. at the moment, a circular button may be pressed by clicking a corner of the button's bounding rectangle, even if that point is not on the visible button itself.
This could be fixed by adding an
is_over
method to theWidget
trait. Arguments should include the widget's boundingRect
,&Widget::State
and&Widget::Style
. One issue with this approach is that theWidget
type itself is not always known when attempting to pick points over widgets. E.g. we need to re-pick which point is under the mouse cursor whenever the mouse is moved. To do this, we need to be able to cast each widget's storedWidget::Style
andWidget::State
back to their original types, which requires knowing theWidget
type itself. Unfortunately theWidget
type is only known during widget instantiation. I'm not yet sure how to solve this, any input appreciated!The text was updated successfully, but these errors were encountered: