Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Widget::is_over method - allows for more precise widget picking #1101

Merged
merged 2 commits into from Dec 6, 2017

Conversation

mitchmindtree
Copy link
Contributor

Based on #1100

This adds a new API for allowing a widget to optionally specify a
function that can be used for determining whether or not a given point
is over the widget. By default, a function that simply checks the
bounding rectangle is used.

This has been implemented for all existing widgets with non-rectangular
bounds (other than Text) including:

  • Line
  • Oval
  • PlotPath
  • PointPath
  • Polygon
  • RoundedRectangle
  • Triangles

Each of the containing modules also provide helper functions that may
aid in the implementation of custom widgets.

This adds a new API for allowing a widget to optionally specify a
function that can be used for determining whether or not a given point
is over the widget. By default, a function that simply checks the
bounding rectangle is used.

This has been implemented for all existing widgets with non-rectangular
bounds (other than `Text`) including:

- `Line`
- `Oval`
- `PointPath`
- `Polygon`
- `RoundedRectangle`
- `Triangles`

Each of the containing modules also provide helper functions that may
aid in the implementation of custom widgets.
@mitchmindtree mitchmindtree merged commit 96208b9 into PistonDevelopers:master Dec 6, 2017
@mitchmindtree mitchmindtree deleted the is_over branch December 6, 2017 05:45
mitchmindtree added a commit to mitchmindtree/conrod that referenced this pull request Dec 12, 2017
Breaking changes include:

- Update to rusttype 0.3.
- Update to glium 0.19, winit 0.9 PistonDevelopers#1107.
- Add new `Widget::is_over` method for more precise picking PistonDevelopers#1101.

Other changes include:

- Add `Graph` widget (WIP) PistonDevelopers#1104.
- Add `Oval` subsections and more point/triangle iterators PistonDevelopers#1100.
mitchmindtree added a commit to mitchmindtree/conrod that referenced this pull request Dec 12, 2017
Breaking changes include:

- Update to rusttype 0.3.
- Update to glium 0.19, winit 0.9 PistonDevelopers#1107.
- Add new `Widget::is_over` method for more precise picking PistonDevelopers#1101.

Other changes include:

- Add `Graph` widget (WIP) PistonDevelopers#1104.
- Add `Oval` subsections and more point/triangle iterators PistonDevelopers#1100.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant