1
0
Fork 0
forked from wry/wry

it: test natural scrolling

This commit is contained in:
Julian Orth 2024-04-02 10:26:42 +02:00
parent f562f887f0
commit adf6d2ae2b
12 changed files with 149 additions and 2 deletions

View file

@ -0,0 +1,12 @@
use crate::tree::ToplevelNode;
pub trait TestToplevelNodeExt {
fn center(&self) -> (i32, i32);
}
impl TestToplevelNodeExt for dyn ToplevelNode {
fn center(&self) -> (i32, i32) {
let rect = self.node_absolute_position();
((rect.x1() + rect.x2()) / 2, (rect.y1() + rect.y2()) / 2)
}
}