}
}
-trait IntoInWindow<T> {
+pub trait IntoInWindow<T> {
fn w_into<'g>(self, w: &'g WindowGuard) -> Result<T, AE>;
}
}
}
+pub trait ActionChainExt: Sized {
+ fn w_move<'g, P: IntoInWindow<WebPos>>
+ (self, w: &'g WindowGuard, pos: P) -> Result<Self,AE>;
+}
+
+impl<'a> ActionChainExt for t4::action_chain::ActionChain<'a> {
+ #[throws(AE)]
+ fn w_move<'g, P: IntoInWindow<WebPos>>
+ (self, w: &'g WindowGuard, pos: P) -> Self
+ {
+ let (px,py) = pos.w_into(w)?;
+ self.move_to(px,py)
+ }
+}
+
impl Drop for Setup {
fn drop(&mut self) {
(||{
let (p2x,p2y) = p2.posw()?;
w.action_chain()
- .move_to(p1x, p1y)
+ .w_move(&w, p1.posw()?)?
.click_and_hold()
.move_to(p2x + 5, p2y + 10)
.release()