本文整理汇总了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);
}
}