PluginProbe
WCPOS – Point of Sale (POS) plugin for WooCommerce / 1.10.21
WCPOS – Point of Sale (POS) plugin for WooCommerce v1.10.21
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 / Inline.php

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

51 lines 1.8 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\Inline as InlineFrameDecorator;
12 use WCPOS\Vendor\Dompdf\Exception;
13 use WCPOS\Vendor\Dompdf\Helpers;
14 /**
15 * Positions inline frames
16 *
17 * @package dompdf
18 */
19 class Inline extends AbstractPositioner
20 {
21 /**
22 * @param AbstractFrameDecorator $frame
23 * @throws Exception
24 */
25 function position(AbstractFrameDecorator $frame) : void
26 {
27 // Find our nearest block level parent and access its lines property
28 $block = $frame->find_block_parent();
29 $cb = $frame->get_containing_block();
30 if (!$block) {
31 // FIXME: An inline frame without block parent should not be
32 // possible, but this can occur currently when the body is styled
33 // with `display: inline !important;` or `display: inline-block !important;`
34 $frame->set_position($cb["x"], $cb["y"]);
35 return;
36 }
37 $line = $block->get_current_line_box();
38 if (!$frame->is_text_node() && !$frame instanceof InlineFrameDecorator) {
39 // Atomic inline boxes and replaced inline elements
40 // (inline-block, inline-table, img etc.)
41 $width = $frame->get_margin_width();
42 $available_width = $cb["w"] - $line->left - $line->w - $line->right;
43 if (Helpers::lengthGreater($width, $available_width)) {
44 $block->add_line();
45 $line = $block->get_current_line_box();
46 }
47 }
48 $frame->set_position($cb["x"] + $line->w, $line->y);
49 }
50 }
51