Icon-O-Matic: import SVG gradient names.
The names are often program generated, but better than no name at all.
This commit is contained in:
parent
42272d2342
commit
7b5ea03f20
@ -792,11 +792,12 @@ DocumentBuilder::_AddShape(path_attributes& attributes, bool outline,
|
||||
|
||||
|
||||
Gradient* gradient = NULL;
|
||||
SVGGradient* g = NULL;
|
||||
const char* url = outline ? attributes.stroke_url : attributes.fill_url;
|
||||
if (url[0] != 0) {
|
||||
if (SVGGradient* g = _FindGradient(url)) {
|
||||
g = _FindGradient(url);
|
||||
if (g != NULL)
|
||||
gradient = g->GetGradient(shape->Bounds());
|
||||
}
|
||||
}
|
||||
|
||||
ObjectDeleter<Gradient> gradientDeleter(gradient);
|
||||
@ -845,8 +846,10 @@ DocumentBuilder::_AddShape(path_attributes& attributes, bool outline,
|
||||
shape->Reset();
|
||||
// }
|
||||
|
||||
if (gradient)
|
||||
if (gradient) {
|
||||
style->SetGradient(gradient);
|
||||
style->SetName(g->ID());
|
||||
}
|
||||
|
||||
shape->SetStyle(style);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user