本文整理汇总了PHP中Block_Frame_Decorator::get_lines方法的典型用法代码示例。如果您正苦于以下问题:PHP Block_Frame_Decorator::get_lines方法的具体用法?PHP Block_Frame_Decorator::get_lines怎么用?PHP Block_Frame_Decorator::get_lines使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Block_Frame_Decorator
的用法示例。
在下文中一共展示了Block_Frame_Decorator::get_lines方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
/**
* Align inline children vertically.
* Aligns each child vertically after each line is reflowed
*/
function vertical_align()
{
foreach ($this->_frame->get_lines() as $i => $line) {
$height = $line["h"];
foreach ($line["frames"] as $frame) {
$style = $frame->get_style();
if ($style->display !== "inline" && $style->display !== "text") {
continue;
}
// FIXME?
if ($this instanceof Table_Cell_Frame_Reflower) {
$align = $frame->get_frame()->get_style()->vertical_align;
} else {
$align = $frame->get_frame()->get_parent()->get_style()->vertical_align;
}
$frame_h = $frame->get_margin_height();
$y = $line["y"];
switch ($align) {
case "baseline":
$y += $height - $frame_h;
break;
case "middle":
$y += ($height + $frame_h) / 2;
break;
case "sub":
$y += 0.2 * $height;
break;
case "super":
$y += -0.3 * $height;
break;
case "text-top":
case "top":
// Not strictly accurate, but good enough for now
break;
case "text-bottom":
case "bottom":
$y += $height - $frame_h;
break;
}
$x = $frame->get_position("x");
$frame->set_position($x, $y);
}
}
}