PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.23
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.23
1.10.25 1.10.24 1.10.23 1.10.22 1.10.21 1.10.20 1.10.19 1.10.18 1.10.17 1.10.16 1.10.15 1.10.13 1.10.14 1.10.12 1.10.11 1.10.10 1.10.9 1.10.8 untagged-3d9b7ccddc54df87c672 1.10.7 1.10.6 1.10.5 1.10.3 1.10.4 1.10.2 All 169 releases
woocommerce-pos / vendor_prefixed / dompdf / dompdf / src / Positioner / ListBullet.php

ListBullet.php in WCPOS – Point of Sale (POS) plugin for WooCommerce 1.10.23, at vendor_prefixed/dompdf/dompdf/src/Positioner/ListBullet.php

40 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 /**
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 use WCPOS\Vendor\Dompdf\FrameDecorator\ListBullet as ListBulletFrameDecorator;
12 /**
13 * Positions list bullets
14 *
15 * @package dompdf
16 */
17 class ListBullet extends AbstractPositioner
18 {
19 /**
20 * @param ListBulletFrameDecorator $frame
21 */
22 function position(AbstractFrameDecorator $frame) : void
23 {
24 // List markers are positioned to the left of the border edge of their
25 // parent element (FIXME: right for RTL)
26 $parent = $frame->get_parent();
27 $style = $parent->get_style();
28 $cbw = $parent->get_containing_block("w");
29 $margin_left = (float) $style->length_in_pt($style->margin_left, $cbw);
30 $border_edge = $parent->get_position("x") + $margin_left;
31 // This includes the marker indentation
32 $x = $border_edge - $frame->get_margin_width();
33 // The marker is later vertically aligned with the corresponding line
34 // box and its vertical position is fine-tuned in the renderer
35 $p = $frame->find_block_parent();
36 $y = $p->get_current_line_box()->y;
37 $frame->set_position($x, $y);
38 }
39 }
40