Skip to content

Commit ec6cdd2

Browse files
authored
Merge pull request #84 from adelhpour/fix-the-issue-with-not-adding-the-colors
Fix a bug and update the version to 0.2.2
2 parents f1e3bf0 + 9150be9 commit ec6cdd2

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.2.1
1+
0.2.2

src/libsbmlnetwork_sbmldocument_render.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,18 +418,22 @@ const std::string getStopColor(SBMLDocument* document, unsigned int renderIndex,
418418
}
419419

420420
int setStopColor(SBMLDocument* document, const std::string& sid, const std::string& stopColor) {
421+
addColor(getGlobalRenderInformation(document), stopColor);
421422
return setStopColor(getGradientDefinition(document, sid), stopColor);
422423
}
423424

424425
int setStopColor(SBMLDocument* document, unsigned int renderIndex, const std::string& sid, const std::string& stopColor) {
426+
addColor(getGlobalRenderInformation(document, renderIndex), stopColor);
425427
return setStopColor(getGradientDefinition(document, renderIndex, sid), stopColor);
426428
}
427429

428430
int setStopColor(SBMLDocument* document, const std::string& sid, unsigned int gradientStopIndex, const std::string& stopColor) {
431+
addColor(getGlobalRenderInformation(document), stopColor);
429432
return setStopColor(getGradientDefinition(document, sid), gradientStopIndex, stopColor);
430433
}
431434

432435
int setStopColor(SBMLDocument* document, unsigned int renderIndex, const std::string& sid, unsigned int gradientStopIndex, const std::string& stopColor) {
436+
addColor(getGlobalRenderInformation(document, renderIndex), stopColor);
433437
return setStopColor(getGradientDefinition(document, renderIndex, sid), gradientStopIndex, stopColor);
434438
}
435439

@@ -3782,6 +3786,7 @@ int setFillColor(SBMLDocument* document, GraphicalObject* graphicalObject, const
37823786
Style* style = getLocalStyle(document, graphicalObject);
37833787
if (!style)
37843788
style = createLocalStyle(document, graphicalObject);
3789+
addColor(document, style, fillColor);
37853790
if (getNumGeometricShapes(style) == 1 && isSetFillColor(getGeometricShape(style)))
37863791
return setFillColor(getGeometricShape(style), fillColor);
37873792

@@ -3796,6 +3801,7 @@ int setFillColor(SBMLDocument* document, const std::string& attribute, const std
37963801
Style* style = getLocalStyle(document, attribute);
37973802
if (!style)
37983803
style = createLocalStyle(document, attribute);
3804+
addColor(document, style, fillColor);
37993805
if (getNumGeometricShapes(style) == 1 && isSetFillColor(getGeometricShape(style)))
38003806
return setFillColor(getGeometricShape(style), fillColor);
38013807

0 commit comments

Comments
 (0)