feat: add pre hook and post hook for Drag action

This commit is contained in:
lilong.129
2025-05-09 23:10:59 +08:00
parent f7ec4a06b4
commit 1dfc473d33
6 changed files with 21 additions and 13 deletions
+3 -2
View File
@@ -659,11 +659,12 @@ func (wd *WDADriver) Drag(fromX, fromY, toX, toY float64, opts ...option.ActionO
toX = wd.toScale(toX)
toY = wd.toScale(toY)
var err error
fromX, fromY, toX, toY, err = handlerDrag(wd, fromX, fromY, toX, toY, opts...)
actionOptions := option.NewActionOptions(opts...)
fromX, fromY, toX, toY, err := preHandler_Drag(wd, actionOptions, fromX, fromY, toX, toY)
if err != nil {
return err
}
defer postHandler(wd, actionOptions)
data := map[string]interface{}{
"fromX": math.Round(fromX*10) / 10,