protected function Canvas($id)
{
$bg = $this->BackgroundImage();
$canvas = array('width' => '100%', 'height' => '100%', 'fill' => $this->back_colour, 'stroke-width' => 0);
if ($this->back_round) {
$canvas['rx'] = $canvas['ry'] = $this->back_round;
}
if ($bg == '' && $this->back_stroke_width) {
$canvas['stroke-width'] = $this->back_stroke_width;
$canvas['stroke'] = $this->back_stroke_colour;
}
$c_el = $this->Element('rect', $canvas);
// create a clip path for rounded rectangle
if ($this->back_round) {
$this->defs[] = $this->Element('clipPath', array('id' => $id), NULL, $c_el);
}
// if the background image is an element, insert it between the background
// colour and border rect
if ($bg != '') {
$c_el .= $bg;
if ($this->back_stroke_width) {
$canvas['stroke-width'] = $this->back_stroke_width;
$canvas['stroke'] = $this->back_stroke_colour;
$canvas['fill'] = 'none';
$c_el .= $this->Element('rect', $canvas);
}
}
return $c_el;
}