From 58ec4c395ffcbde5a2bf6a1890f96783167fdc8c Mon Sep 17 00:00:00 2001 From: RickyRister Date: Sat, 1 Feb 2025 17:18:29 -0800 Subject: [PATCH] add comments --- cockatrice/src/client/ui/pixel_map_generator.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/cockatrice/src/client/ui/pixel_map_generator.cpp b/cockatrice/src/client/ui/pixel_map_generator.cpp index 5f83e03dd..37bc3e4f1 100644 --- a/cockatrice/src/client/ui/pixel_map_generator.cpp +++ b/cockatrice/src/client/ui/pixel_map_generator.cpp @@ -100,7 +100,16 @@ QPixmap CountryPixmapGenerator::generatePixmap(int height, const QString &countr QMap CountryPixmapGenerator::pmCache; -void SetAttrRecur(QDomElement &elem, +/** + * Updates tags in the svg + * + * @param elem The svg + * @param tagName tag with attribute to update + * @param attrName attribute to be updated + * @param idName id that the tag has to match + * @param attrValue the value to update the attribute to + */ +void setAttrRecur(QDomElement &elem, const QString &tagName, const QString &attrName, const QString &idName, @@ -117,10 +126,13 @@ void SetAttrRecur(QDomElement &elem, continue; } auto docElem = elem.childNodes().at(i).toElement(); - SetAttrRecur(docElem, tagName, attrName, idName, attrValue); + setAttrRecur(docElem, tagName, attrName, idName, attrValue); } } +/** + * Returns an icon of the svg that has its color filled in + */ QIcon changeSVGColor(const QString &iconPath, const QString &colorLeft, const std::optional &colorRight) { QFile file(iconPath);