io/router: use integer coordinates for bounds

There is no need for floating point coordinates, except for transforming
bounds and hit testing.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2022-03-30 12:08:48 +02:00
parent 1f11a5a17b
commit e72c46f13c
5 changed files with 26 additions and 26 deletions
+2 -2
View File
@@ -605,7 +605,7 @@ func Java_org_gioui_GioView_initializeAccessibilityNodeInfo(env *C.JNIEnv, class
semID := w.semIDFor(virtID)
sem, found := w.callbacks.LookupSemantic(semID)
if found {
off := f32.Pt(float32(screenX), float32(screenY))
off := image.Pt(int(screenX), int(screenY))
if err := w.initAccessibilityNodeInfo(env, sem, off, info); err != nil {
panic(err)
}
@@ -657,7 +657,7 @@ func Java_org_gioui_GioView_onClearA11yFocus(env *C.JNIEnv, class C.jclass, view
}
}
func (w *window) initAccessibilityNodeInfo(env *C.JNIEnv, sem router.SemanticNode, off f32.Point, info C.jobject) error {
func (w *window) initAccessibilityNodeInfo(env *C.JNIEnv, sem router.SemanticNode, off image.Point, info C.jobject) error {
for _, ch := range sem.Children {
err := callVoidMethod(env, info, android.accessibilityNodeInfo.addChild, jvalue(w.view), jvalue(w.virtualIDFor(ch.ID)))
if err != nil {