anvil.shell: use correct region in contains_point

The one in SurfaceAttributes has potentially not been committed yet, and
the one in SurfaceData is the most up-to-date committed one.
This commit is contained in:
Ivan Molodetskikh 2020-02-02 12:42:23 +03:00
parent fac4ca260e
commit 13cac4f693
No known key found for this signature in database
GPG Key ID: 02CE38DA47E9D691
1 changed files with 4 additions and 2 deletions

View File

@ -200,10 +200,12 @@ fn contains_point(attrs: &SurfaceAttributes, point: (f64, f64)) -> bool {
return false;
}
let input_region = &attrs.user_data.get::<SurfaceData>().unwrap().input_region;
// If there's no input region, we're done.
if attrs.input_region.is_none() {
if input_region.is_none() {
return true;
}
attrs.input_region.as_ref().unwrap().contains(point)
input_region.as_ref().unwrap().contains(point)
}