diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-11-30 10:10:43 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-11-30 10:10:43 +0000 |
commit | 7854dda880c76ae04d9bca5a5240271f6971c1bd (patch) | |
tree | f06ec1990d9c5bc61ace026f2963234fce80c888 /src/driver/svg.php | |
parent | 5ced6d5c25202717ef3ec1a811cffba6b44bcb79 (diff) | |
download | zetacomponents-graph-7854dda880c76ae04d9bca5a5240271f6971c1bd.zip zetacomponents-graph-7854dda880c76ae04d9bca5a5240271f6971c1bd.tar.gz |
- Fixed: Bug #9612 (Element links for SVG image in the legend require you to
click on exactly the text.)
Diffstat (limited to 'src/driver/svg.php')
-rw-r--r-- | src/driver/svg.php | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/driver/svg.php b/src/driver/svg.php index 829b73a..4965a51 100644 --- a/src/driver/svg.php +++ b/src/driver/svg.php @@ -497,8 +497,15 @@ class ezcGraphSvgDriver extends ezcGraphDriver */ protected function drawAllTexts() { + $elementsRoot = $this->elements; + foreach ( $this->strings as $text ) { + // Add all text elements into one group + $this->elements = $this->dom->createElement( 'g' ); + $this->elements->setAttribute( 'id', $text['id'] ); + $this->elements = $elementsRoot->appendChild( $this->elements ); + $size = $text['font']->minimalUsedFont; $font = $text['font']->name; @@ -595,6 +602,17 @@ class ezcGraphSvgDriver extends ezcGraphDriver true ); } + else + { + // Always draw full tranparent background polygon as fallback, + // to be able to click on complete font space, not only on + // the text + $this->drawPolygon( + $borderPolygonArray, + ezcGraphColor::fromHex( '#FFFFFFFF' ), + true + ); + } if ( $text['font']->border !== false ) { @@ -640,7 +658,7 @@ class ezcGraphSvgDriver extends ezcGraphDriver if ( $text['font']->textShadow === true ) { $textNode = $this->dom->createElement( 'text', htmlspecialchars( $string ) ); - $textNode->setAttribute( 'id', $text['id'] ); + $textNode->setAttribute( 'id', $text['id'] . '_shadow' ); $textNode->setAttribute( 'x', $position->x + $this->options->graphOffset->x + $text['font']->textShadowOffset ); $textNode->setAttribute( 'text-length', $this->getTextWidth( $string, $size ) . 'px' ); $textNode->setAttribute( 'y', $position->y + $this->options->graphOffset->y + $text['font']->textShadowOffset ); @@ -661,7 +679,7 @@ class ezcGraphSvgDriver extends ezcGraphDriver // Finally draw text $textNode = $this->dom->createElement( 'text', htmlspecialchars( $string ) ); - $textNode->setAttribute( 'id', $text['id'] ); + $textNode->setAttribute( 'id', $text['id'] . '_text' ); $textNode->setAttribute( 'x', $position->x + $this->options->graphOffset->x ); $textNode->setAttribute( 'text-length', $this->getTextWidth( $string, $size ) . 'px' ); $textNode->setAttribute( 'y', $position->y + $this->options->graphOffset->y ); @@ -682,6 +700,8 @@ class ezcGraphSvgDriver extends ezcGraphDriver $text['position']->y += $size + $size * $this->options->lineSpacing; } } + + $this->elements = $elementsRoot; } /** |