當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Frame_Decorator::get_border_box方法代碼示例

本文整理匯總了PHP中Frame_Decorator::get_border_box方法的典型用法代碼示例。如果您正苦於以下問題:PHP Frame_Decorator::get_border_box方法的具體用法?PHP Frame_Decorator::get_border_box怎麽用?PHP Frame_Decorator::get_border_box使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Frame_Decorator的用法示例。


在下文中一共展示了Frame_Decorator::get_border_box方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _render_border

 protected function _render_border(Frame_Decorator $frame, $corner_style = "bevel")
 {
     $cb = $frame->get_containing_block();
     $style = $frame->get_style();
     $bbox = $frame->get_border_box();
     $bp = $frame->get_style()->get_border_properties();
     $widths = array($style->length_in_pt($bp["top"]["width"]), $style->length_in_pt($bp["right"]["width"]), $style->length_in_pt($bp["bottom"]["width"]), $style->length_in_pt($bp["left"]["width"]));
     foreach ($bp as $side => $props) {
         list($x, $y, $w, $h) = $bbox;
         if (!$props["style"] || $props["style"] == "none" || $props["width"] <= 0) {
             continue;
         }
         switch ($side) {
             case "top":
                 $length = $w;
                 break;
             case "bottom":
                 $length = $w;
                 $y += $h;
                 break;
             case "left":
                 $length = $h;
                 break;
             case "right":
                 $length = $h;
                 $x += $w;
                 break;
             default:
                 break;
         }
         $method = "_border_" . $props["style"];
         $this->{$method}($x, $y, $length, $props["color"], $widths, $side, $corner_style);
     }
 }
開發者ID:emeraldstudio,項目名稱:somosmaestros,代碼行數:34,代碼來源:block_renderer.cls.php

示例2: _render_outline

 protected function _render_outline(Frame_Decorator $frame, $corner_style = "bevel")
 {
     $style = $frame->get_style();
     $props = array("width" => $style->outline_width, "style" => $style->outline_style, "color" => $style->outline_color);
     if (!$props["style"] || $props["style"] === "none" || $props["width"] <= 0) {
         return;
     }
     $bbox = $frame->get_border_box();
     $offset = $style->length_in_pt($props["width"]);
     $pattern = $this->_get_dash_pattern($props["style"], $offset);
     if (in_array($props["style"], array("solid", "dashed", "dotted"))) {
         $bbox[0] -= $offset / 2;
         $bbox[1] -= $offset / 2;
         $bbox[2] += $offset;
         $bbox[3] += $offset;
         list($x, $y, $w, $h) = $bbox;
         $this->_canvas->rectangle($x, $y, $w, $h, $props["color"], $offset, $pattern);
         return;
     }
     $bbox[0] -= $offset;
     $bbox[1] -= $offset;
     $bbox[2] += $offset * 2;
     $bbox[3] += $offset * 2;
     $method = "_border_" . $props["style"];
     $widths = array_fill(0, 4, $props["width"]);
     $sides = array("top", "right", "left", "bottom");
     foreach ($sides as $side) {
         list($x, $y, $w, $h) = $bbox;
         switch ($side) {
             case "top":
                 $length = $w;
                 break;
             case "bottom":
                 $length = $w;
                 $y += $h;
                 break;
             case "left":
                 $length = $h;
                 break;
             case "right":
                 $length = $h;
                 $x += $w;
                 break;
             default:
                 break;
         }
         $this->{$method}($x, $y, $length, $props["color"], $widths, $side, $corner_style);
     }
 }
開發者ID:EfncoPlugins,項目名稱:web-portal-lite-client-portal-secure-file-sharing-private-messaging,代碼行數:49,代碼來源:block_renderer.cls.php


注:本文中的Frame_Decorator::get_border_box方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。