当前位置: 首页>>代码示例>>PHP>>正文


PHP Block_Frame_Decorator::get_reflower方法代码示例

本文整理汇总了PHP中Block_Frame_Decorator::get_reflower方法的典型用法代码示例。如果您正苦于以下问题:PHP Block_Frame_Decorator::get_reflower方法的具体用法?PHP Block_Frame_Decorator::get_reflower怎么用?PHP Block_Frame_Decorator::get_reflower使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Block_Frame_Decorator的用法示例。


在下文中一共展示了Block_Frame_Decorator::get_reflower方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: foreach

    function get_float_offsets()
    {
        if (!DOMPDF_ENABLE_CSS_FLOAT) {
            return;
        }

        static $anti_infinite_loop = 500; // FIXME smelly hack

        $reflower = $this->_block_frame->get_reflower();

        if (!$reflower) return;

        $cb_w = null;

        $block = $this->_block_frame;
        $root = $block->get_root();
        $floating_frames = $this->get_floats_inside($root);

        foreach ($floating_frames as $child_key => $floating_frame) {
            $id = $floating_frame->get_id();

            if (isset($this->floating_blocks[$id])) {
                continue;
            }

            $floating_style = $floating_frame->get_style();

            $clear = $floating_style->clear;
            $float = $floating_style->float;

            $floating_width = $floating_frame->get_margin_width();

            if (!$cb_w) {
                $cb_w = $floating_frame->get_containing_block("w");
            }

            $line_w = $this->get_width();

            if (!$floating_frame->_float_next_line && ($cb_w <= $line_w + $floating_width) && ($cb_w > $line_w)) {
                $floating_frame->_float_next_line = true;
                continue;
            }

            // If the child is still shifted by the floating element
            if ($anti_infinite_loop-- > 0 &&
                $floating_frame->get_position("y") + $floating_frame->get_margin_height() > $this->y &&
                $block->get_position("x") + $block->get_margin_width() > $floating_frame->get_position("x")
            ) {
                if ($float === "left")
                    $this->left += $floating_width;
                else
                    $this->right += $floating_width;

                $this->floating_blocks[$id] = true;
            } // else, the floating element won't shift anymore
            else {
                $root->remove_floating_frame($child_key);
            }
        }
    }
开发者ID:rmuyinda,项目名称:dms-1,代码行数:60,代码来源:line_box.cls.php

示例2: foreach

 function get_float_offsets()
 {
     $enable_css_float = $this->_block_frame->get_dompdf()->get_option("enable_css_float");
     if (!$enable_css_float) {
         return;
     }
     static $anti_infinite_loop = 500;
     // FIXME smelly hack
     $reflower = $this->_block_frame->get_reflower();
     if (!$reflower) {
         return;
     }
     $cb_w = null;
     $block = $this->_block_frame;
     $root = $block->get_root();
     if (!$root) {
         return;
     }
     $floating_frames = $this->get_floats_inside($root);
     foreach ($floating_frames as $child_key => $floating_frame) {
         $id = $floating_frame->get_id();
         if (isset($this->floating_blocks[$id])) {
             continue;
         }
         $floating_style = $floating_frame->get_style();
         $float = $floating_style->float;
         $floating_width = $floating_frame->get_margin_width();
         if (!$cb_w) {
             $cb_w = $floating_frame->get_containing_block("w");
         }
         $line_w = $this->get_width();
         if (!$floating_frame->_float_next_line && $cb_w <= $line_w + $floating_width && $cb_w > $line_w) {
             $floating_frame->_float_next_line = true;
             continue;
         }
         // If the child is still shifted by the floating element
         if ($anti_infinite_loop-- > 0 && $floating_frame->get_position("y") + $floating_frame->get_margin_height() > $this->y && $block->get_position("x") + $block->get_margin_width() > $floating_frame->get_position("x")) {
             if ($float === "left") {
                 $this->left += $floating_width;
             } else {
                 $this->right += $floating_width;
             }
             $this->floating_blocks[$id] = true;
         } else {
             $root->remove_floating_frame($child_key);
         }
     }
 }
开发者ID:TheTypoMaster,项目名称:SPHERE-Framework,代码行数:48,代码来源:line_box.cls.php

示例3: foreach

 function get_float_offsets()
 {
     static $anti_infinite_loop;
     $reflower = $this->_block_frame->get_reflower();
     if (!$reflower) {
         return;
     }
     $cb_w = null;
     if (DOMPDF_ENABLE_CSS_FLOAT) {
         $block = $this->_block_frame;
         $root = $block->get_root();
         $floating_frames = $root->get_floating_frames();
         foreach ($floating_frames as $child_key => $floating_frame) {
             $id = $floating_frame->get_id();
             if (isset($this->floating_blocks[$id])) {
                 continue;
             }
             $float = $floating_frame->get_style()->float;
             $floating_width = $floating_frame->get_margin_width();
             if (!$cb_w) {
                 $cb_w = $floating_frame->get_containing_block("w");
             }
             $line_w = $this->get_width();
             if (!$floating_frame->_float_next_line && $cb_w <= $line_w + $floating_width && $cb_w > $line_w) {
                 $floating_frame->_float_next_line = true;
                 continue;
             }
             // If the child is still shifted by the floating element
             if ($anti_infinite_loop++ < 1000 && $floating_frame->get_position("y") + $floating_frame->get_margin_height() > $this->y && $block->get_position("x") + $block->get_margin_width() > $floating_frame->get_position("x")) {
                 if ($float === "left") {
                     $this->left += $floating_width;
                 } else {
                     $this->right += $floating_width;
                 }
                 $this->floating_blocks[$id] = true;
             } else {
                 $root->remove_floating_frame($child_key);
             }
         }
     }
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:41,代码来源:line_box.cls.php

示例4: foreach

 function get_float_offsets()
 {
     $reflower = $this->_block_frame->get_reflower();
     if (!$reflower) {
         return;
     }
     $floating_children = $reflower->get_floating_children();
     $cb_w = null;
     if (DOMPDF_ENABLE_CSS_FLOAT && !empty($floating_children)) {
         foreach ($floating_children as $child_key => $floating_child) {
             $id = $floating_child->get_id();
             if (isset($this->floating_blocks[$id])) {
                 continue;
             }
             $float = $floating_child->get_style()->float;
             $floating_width = $floating_child->get_margin_width();
             if (!$cb_w) {
                 $cb_w = $floating_child->get_containing_block("w");
             }
             $line_w = $this->get_width();
             if (!$floating_child->_float_next_line && $cb_w <= $line_w + $floating_width && $cb_w > $line_w) {
                 $floating_child->_float_next_line = true;
                 continue;
             }
             // If the child is still shifted by the floating element
             if ($floating_child->get_position("y") + $floating_child->get_margin_height() > $this->y) {
                 if ($float === "left") {
                     $this->left += $floating_width;
                 } else {
                     $this->right += $floating_width;
                 }
                 $this->floating_blocks[$id] = true;
             } else {
                 $reflower->remove_floating_child($child_key);
             }
         }
     }
 }
开发者ID:practo,项目名称:dompdf,代码行数:38,代码来源:line_box.cls.php


注:本文中的Block_Frame_Decorator::get_reflower方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。