Fix some bugs

This commit is contained in:
sunsets
2024-01-17 14:35:16 +08:00
parent 2f7a8a7568
commit ec37905b75
6 changed files with 31 additions and 6 deletions

View File

@@ -403,11 +403,12 @@ wxBitmapBundle* BitmapCache::from_svg(const std::string& bitmap_name, unsigned t
return it->second;
// map of color replaces
//B48
std::map<std::string, std::string> replaces;
if (dark_mode)
replaces["#808080"] = "#FFFFFF";
if (!new_color.empty())
replaces["#ED6B21"] = new_color;
replaces["#4479FB"] = new_color;
replaces["#ButtonBG"] = dark_mode ? "#4E4E4E" : "#828282";
@@ -461,11 +462,12 @@ wxBitmap* BitmapCache::load_svg(const std::string &bitmap_name, unsigned target_
return it->second;
// map of color replaces
//B48
std::map<std::string, std::string> replaces;
if (dark_mode)
replaces["#808080"] = "#FFFFFF";
if (!new_color.empty())
replaces["#ED6B21"] = new_color;
replaces["#4479FB"] = new_color;
NSVGimage *image = nsvgParseFromFileWithReplace(Slic3r::var(bitmap_name + ".svg").c_str(), "px", 96.0f, replaces);
if (image == nullptr)