| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* @package dompdf |
| 5 |
* @link https://github.com/dompdf/dompdf |
| 6 |
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License |
| 7 |
*/ |
| 8 |
namespace WCPOS\Vendor\Dompdf\Positioner; |
| 9 |
|
| 10 |
use WCPOS\Vendor\Dompdf\FrameDecorator\AbstractFrameDecorator; |
| 11 |
/** |
| 12 |
* Base AbstractPositioner class |
| 13 |
* |
| 14 |
* Defines positioner interface |
| 15 |
* |
| 16 |
* @package dompdf |
| 17 |
*/ |
| 18 |
abstract class AbstractPositioner |
| 19 |
{ |
| 20 |
/** |
| 21 |
* @param AbstractFrameDecorator $frame |
| 22 |
*/ |
| 23 |
abstract function position(AbstractFrameDecorator $frame) : void; |
| 24 |
/** |
| 25 |
* @param AbstractFrameDecorator $frame |
| 26 |
* @param float $offset_x |
| 27 |
* @param float $offset_y |
| 28 |
* @param bool $ignore_self |
| 29 |
*/ |
| 30 |
function move(AbstractFrameDecorator $frame, float $offset_x, float $offset_y, bool $ignore_self = \false) : void |
| 31 |
{ |
| 32 |
[$x, $y] = $frame->get_position(); |
| 33 |
if (!$ignore_self) { |
| 34 |
$frame->set_position($x + $offset_x, $y + $offset_y); |
| 35 |
} |
| 36 |
foreach ($frame->get_children() as $child) { |
| 37 |
$child->move($offset_x, $offset_y); |
| 38 |
} |
| 39 |
} |
| 40 |
} |
| 41 |
|