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


PHP ezcGraphRenderer::drawStepLine方法代码示例

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


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

示例1: drawStep

 /**
  * Draw single step on a axis
  *
  * Draws a step on a axis at the current position
  * 
  * @param ezcGraphRenderer $renderer Renderer to draw the step with
  * @param ezcGraphCoordinate $position Position of step
  * @param ezcGraphCoordinate $direction Direction of axis
  * @param int $axisPosition Position of axis
  * @param int $size Step size
  * @param ezcGraphColor $color Color of axis
  * @return void
  */
 public function drawStep(ezcGraphRenderer $renderer, ezcGraphCoordinate $position, ezcGraphCoordinate $direction, $axisPosition, $size, ezcGraphColor $color)
 {
     if (!($this->innerStep || $this->outerStep)) {
         return false;
     }
     $drawStep = false;
     if ($axisPosition === ezcGraph::CENTER && $this->innerStep || $axisPosition === ezcGraph::BOTTOM && $this->outerStep || $axisPosition === ezcGraph::TOP && $this->innerStep || $axisPosition === ezcGraph::RIGHT && $this->outerStep || $axisPosition === ezcGraph::LEFT && $this->innerStep) {
         // Turn direction vector to left by 90 degrees and multiply
         // with major step size
         $stepStart = new ezcGraphCoordinate($position->x + $direction->y * $size, $position->y - $direction->x * $size);
         $drawStep = true;
     } else {
         $stepStart = $position;
     }
     if ($axisPosition === ezcGraph::CENTER && $this->innerStep || $axisPosition === ezcGraph::BOTTOM && $this->innerStep || $axisPosition === ezcGraph::TOP && $this->outerStep || $axisPosition === ezcGraph::RIGHT && $this->innerStep || $axisPosition === ezcGraph::LEFT && $this->outerStep) {
         // Turn direction vector to right by 90 degrees and multiply
         // with major step size
         $stepEnd = new ezcGraphCoordinate($position->x - $direction->y * $size, $position->y + $direction->x * $size);
         $drawStep = true;
     } else {
         $stepEnd = $position;
     }
     if ($drawStep) {
         $renderer->drawStepLine($stepStart, $stepEnd, $color);
     }
 }
开发者ID:jordanmanning,项目名称:ezpublish,代码行数:39,代码来源:axis_label_renderer.php


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