PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.13.1
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.13.1
3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 2.8.17 2.8.18 All 259 releases
wpfunnels / vendor / intervention / image / src / Intervention / Image / AbstractShape.php

AbstractShape.php in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 3.13.1, at vendor/intervention/image/src/Intervention/Image/AbstractShape.php

72 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Intervention\Image;
4
5 abstract class AbstractShape
6 {
7 /**
8 * Background color of shape
9 *
10 * @var string
11 */
12 public $background;
13
14 /**
15 * Border color of current shape
16 *
17 * @var string
18 */
19 public $border_color;
20
21 /**
22 * Border width of shape
23 *
24 * @var int
25 */
26 public $border_width = 0;
27
28 /**
29 * Draws shape to given image on given position
30 *
31 * @param Image $image
32 * @param int $posx
33 * @param int $posy
34 * @return boolean
35 */
36 abstract public function applyToImage(Image $image, $posx = 0, $posy = 0);
37
38 /**
39 * Set text to be written
40 *
41 * @param string $text
42 * @return void
43 */
44 public function background($color)
45 {
46 $this->background = $color;
47 }
48
49 /**
50 * Set border width and color of current shape
51 *
52 * @param int $width
53 * @param string $color
54 * @return void
55 */
56 public function border($width, $color = null)
57 {
58 $this->border_width = is_numeric($width) ? intval($width) : 0;
59 $this->border_color = is_null($color) ? '#000000' : $color;
60 }
61
62 /**
63 * Determines if current shape has border
64 *
65 * @return boolean
66 */
67 public function hasBorder()
68 {
69 return ($this->border_width >= 1);
70 }
71 }
72