Skip to content

Commit

Permalink
Merge pull request #84 from adelhpour/fix-the-issue-with-not-adding-t…
Browse files Browse the repository at this point in the history
…he-colors

Fix a bug and update the version to 0.2.2
  • Loading branch information
adelhpour committed Aug 31, 2024
2 parents f1e3bf0 + 9150be9 commit ec6cdd2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.1
0.2.2
6 changes: 6 additions & 0 deletions src/libsbmlnetwork_sbmldocument_render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,18 +418,22 @@ const std::string getStopColor(SBMLDocument* document, unsigned int renderIndex,
}

int setStopColor(SBMLDocument* document, const std::string& sid, const std::string& stopColor) {
addColor(getGlobalRenderInformation(document), stopColor);
return setStopColor(getGradientDefinition(document, sid), stopColor);
}

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

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

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

Expand Down Expand Up @@ -3782,6 +3786,7 @@ int setFillColor(SBMLDocument* document, GraphicalObject* graphicalObject, const
Style* style = getLocalStyle(document, graphicalObject);
if (!style)
style = createLocalStyle(document, graphicalObject);
addColor(document, style, fillColor);
if (getNumGeometricShapes(style) == 1 && isSetFillColor(getGeometricShape(style)))
return setFillColor(getGeometricShape(style), fillColor);

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

Expand Down

0 comments on commit ec6cdd2

Please sign in to comment.