Cleanup
Signed-off-by: falkTX <falktx@falktx.com>
This commit is contained in:
parent
9be8413054
commit
39f240f705
1 changed files with 4 additions and 5 deletions
|
|
@ -867,6 +867,7 @@ NSVGimage* nsvgParseFromFileCardinal(const char* const filename, const char* con
|
||||||
|
|
||||||
bool hasDarkMode = false;
|
bool hasDarkMode = false;
|
||||||
bool hasLightMode = false;
|
bool hasLightMode = false;
|
||||||
|
NSVGimage* handleOrig;
|
||||||
NSVGimage* handleMOD = nullptr;
|
NSVGimage* handleMOD = nullptr;
|
||||||
NSVGshape* shapesOrig;
|
NSVGshape* shapesOrig;
|
||||||
NSVGshape* shapesMOD;
|
NSVGshape* shapesMOD;
|
||||||
|
|
@ -991,8 +992,6 @@ NSVGimage* nsvgParseFromFileCardinal(const char* const filename, const char* con
|
||||||
handle->shapes->fill.color = 0xff191919;
|
handle->shapes->fill.color = 0xff191919;
|
||||||
|
|
||||||
postparse:
|
postparse:
|
||||||
NSVGimage* handleOrig;
|
|
||||||
|
|
||||||
if (handleMOD != nullptr)
|
if (handleMOD != nullptr)
|
||||||
{
|
{
|
||||||
handleOrig = static_cast<NSVGimage*>(malloc(sizeof(NSVGimage)));
|
handleOrig = static_cast<NSVGimage*>(malloc(sizeof(NSVGimage)));
|
||||||
|
|
@ -1066,7 +1065,7 @@ void nsvgDeleteCardinal(NSVGimage* const handle)
|
||||||
nsvgDelete(handle);
|
nsvgDelete(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
void switchDarkMode(bool darkMode)
|
void switchDarkMode(const bool darkMode)
|
||||||
{
|
{
|
||||||
if (rack::settings::darkMode == darkMode)
|
if (rack::settings::darkMode == darkMode)
|
||||||
return;
|
return;
|
||||||
|
|
@ -1084,8 +1083,8 @@ void switchDarkMode(bool darkMode)
|
||||||
for (ExtendedNSVGimage& ext : loadedLightSVGs)
|
for (ExtendedNSVGimage& ext : loadedLightSVGs)
|
||||||
{
|
{
|
||||||
if (ext.shapesMOD != nullptr)
|
if (ext.shapesMOD != nullptr)
|
||||||
ext.handle->shapes = darkMode ? ext.shapesOrig : ext.shapesMOD;
|
ext.handle->shapes = !darkMode ? ext.shapesMOD : ext.shapesOrig;
|
||||||
else if (ext.handleMOD != nullptr)
|
else if (ext.handleMOD != nullptr)
|
||||||
std::memcpy(ext.handle, darkMode ? ext.handleOrig : ext.handleMOD, sizeof(NSVGimage));
|
std::memcpy(ext.handle, !darkMode ? ext.handleMOD : ext.handleOrig, sizeof(NSVGimage));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue