diff --git a/src/Input/Mouse.php b/src/Input/Mouse.php index c94e23b..ad9292c 100644 --- a/src/Input/Mouse.php +++ b/src/Input/Mouse.php @@ -31,8 +31,8 @@ class Mouse */ protected $page; - protected $x = 0; - protected $y = 0; + protected $x = 0.0; + protected $y = 0.0; protected $button = self::BUTTON_NONE; @@ -45,8 +45,8 @@ public function __construct(Page $page) } /** - * @param int $x - * @param int $y + * @param float $x + * @param float $y * @param array|null $options * * @throws \HeadlessChromium\Exception\CommunicationException @@ -54,7 +54,7 @@ public function __construct(Page $page) * * @return $this */ - public function move(int $x, int $y, array $options = null) + public function move(float $x, float $y, array $options = null) { $this->page->assertNotClosed(); @@ -329,13 +329,13 @@ public function findElement(Selector $selector, int $position = 1): self /** * Get the maximum distance to scroll a page. * - * @param int $distance Distance to scroll, positive or negative - * @param int $current Current position - * @param int $maximum Maximum possible distance + * @param float $distance Distance to scroll, positive or negative + * @param float $current Current position + * @param float $maximum Maximum possible distance * - * @return int allowed distance to scroll + * @return float allowed distance to scroll */ - private function getMaximumDistance(int $distance, int $current, int $maximum): int + private function getMaximumDistance(float $distance, float $current, float $maximum): float { $result = $current + $distance;