Point.php in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 3.13.1, at vendor/intervention/image/src/Intervention/Image/Point.php
| 1 | <?php |
| 2 | |
| 3 | namespace Intervention\Image; |
| 4 | |
| 5 | class Point |
| 6 | { |
| 7 | /** |
| 8 | * X coordinate |
| 9 | * |
| 10 | * @var int |
| 11 | */ |
| 12 | public $x; |
| 13 | |
| 14 | /** |
| 15 | * Y coordinate |
| 16 | * |
| 17 | * @var int |
| 18 | */ |
| 19 | public $y; |
| 20 | |
| 21 | /** |
| 22 | * Creates a new instance |
| 23 | * |
| 24 | * @param int $x |
| 25 | * @param int $y |
| 26 | */ |
| 27 | public function __construct($x = null, $y = null) |
| 28 | { |
| 29 | $this->x = is_numeric($x) ? intval($x) : 0; |
| 30 | $this->y = is_numeric($y) ? intval($y) : 0; |
| 31 | } |
| 32 | |
| 33 | /** |
| 34 | * Sets X coordinate |
| 35 | * |
| 36 | * @param int $x |
| 37 | */ |
| 38 | public function setX($x) |
| 39 | { |
| 40 | $this->x = intval($x); |
| 41 | } |
| 42 | |
| 43 | /** |
| 44 | * Sets Y coordinate |
| 45 | * |
| 46 | * @param int $y |
| 47 | */ |
| 48 | public function setY($y) |
| 49 | { |
| 50 | $this->y = intval($y); |
| 51 | } |
| 52 | |
| 53 | /** |
| 54 | * Sets both X and Y coordinate |
| 55 | * |
| 56 | * @param int $x |
| 57 | * @param int $y |
| 58 | */ |
| 59 | public function setPosition($x, $y) |
| 60 | { |
| 61 | $this->setX($x); |
| 62 | $this->setY($y); |
| 63 | } |
| 64 | } |
| 65 |