Commit b08b5eb6 by sn

svg kleinigkeiten

1 parent cb42af21
Showing with 4 additions and 4 deletions
No preview for this file type
<?php <?php
class mcSvg { class mcSvg {
public static function getGraticuleAsDomElement(DOMElement $param_domelement, $param_x=0, $param_y=0, $param_lenght=10, $param_disableCircleIfSmallAs=false) { public static function getGraticuleAsDomElement(DOMElement $param_domelement, $param_x=0, $param_y=0, $param_lenght=10, $param_disableCircleIfSmallAs=false, $param_color='black') {
$group = new DOMElement('g'); $group = new DOMElement('g');
$group = $param_domelement->appendChild($group); $group = $param_domelement->appendChild($group);
...@@ -11,7 +11,7 @@ class mcSvg { ...@@ -11,7 +11,7 @@ class mcSvg {
$circle->setAttribute('cx', $param_x); $circle->setAttribute('cx', $param_x);
$circle->setAttribute('cy', $param_y); $circle->setAttribute('cy', $param_y);
$circle->setAttribute('r', $param_lenght/3); $circle->setAttribute('r', $param_lenght/3);
$circle->setAttribute('style', 'fill:#FFFFFF; stroke:black; stroke-width:.01cm;'); $circle->setAttribute('style', 'fill:#FFFFFF; stroke:'.$param_color.'; stroke-width:.01cm;');
} }
...@@ -21,14 +21,14 @@ class mcSvg { ...@@ -21,14 +21,14 @@ class mcSvg {
$line_vertikal->setAttribute('y1', $param_y - ($param_lenght/2)); $line_vertikal->setAttribute('y1', $param_y - ($param_lenght/2));
$line_vertikal->setAttribute('x2', $param_x); $line_vertikal->setAttribute('x2', $param_x);
$line_vertikal->setAttribute('y2', $param_y + ($param_lenght/2)); $line_vertikal->setAttribute('y2', $param_y + ($param_lenght/2));
$line_vertikal->setAttribute('style', 'stroke:black; stroke-width:.01cm;'); $line_vertikal->setAttribute('style', 'stroke:'.$param_color.'; stroke-width:.01cm;');
$line_horizontal = $group->appendChild(new DOMElement('line')); $line_horizontal = $group->appendChild(new DOMElement('line'));
$line_horizontal->setAttribute('x1', $param_x - ($param_lenght/2)); $line_horizontal->setAttribute('x1', $param_x - ($param_lenght/2));
$line_horizontal->setAttribute('y1', $param_y); $line_horizontal->setAttribute('y1', $param_y);
$line_horizontal->setAttribute('x2', $param_x + ($param_lenght/2)); $line_horizontal->setAttribute('x2', $param_x + ($param_lenght/2));
$line_horizontal->setAttribute('y2', $param_y); $line_horizontal->setAttribute('y2', $param_y);
$line_horizontal->setAttribute('style', 'stroke:black; stroke-width:.01cm;'); $line_horizontal->setAttribute('style', 'stroke:'.$param_color.'; stroke-width:.01cm;');
return $group; return $group;
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!