protected function setStyles($obj)
{
if (null !== $this->curClippingPath) {
$obj->addAttribute('style', 'clip-path: url(#clip' . $this->curClippingPath . ');');
}
if (null !== $this->curGradient) {
$obj->addAttribute('fill', 'url(#grad' . $this->curGradient . ')');
} else {
if (null !== $this->fillColor) {
$obj->addAttribute('fill', $this->fillColor->get(3, true));
if ($this->opacity < 1.0) {
$obj->addAttribute('fill-opacity', $this->opacity);
}
}
}
if (null !== $this->strokeColor) {
$obj->addAttribute('stroke', $this->strokeColor->get(3, true));
$obj->addAttribute('stroke-width', (null !== $this->strokeWidth ? $this->strokeWidth : 1) . $this->units);
if (null !== $this->strokeDashLength && null !== $this->strokeDashGap) {
$obj->addAttribute('stroke-dasharray', $this->strokeDashLength . $this->units . ',' . $this->strokeDashGap . $this->units);
}
}
return $obj;
}