ENH:display different thumbnails according to the printer type

Change-Id: I1534594923fdcafb231661a1a7fa289221277449
This commit is contained in:
tao wang 2022-12-09 18:34:28 +08:00 committed by Lane.Wei
parent 5139edb876
commit b5e38e02fe
14 changed files with 474 additions and 387 deletions

View file

@ -335,7 +335,15 @@ wxBitmap* BitmapCache::load_svg(const std::string &bitmap_name, unsigned target_
//if (!new_color.empty())
// replaces["\"#ED6B21\""] = "\"" + new_color + "\"";
NSVGimage *image = nsvgParseFromFileWithReplace(Slic3r::var(bitmap_name + ".svg").c_str(), "px", 96.0f, replaces);
NSVGimage *image = nullptr;
if (strstr(bitmap_name.c_str(), "printer_thumbnail") == NULL) {
image = nsvgParseFromFileWithReplace(Slic3r::var(bitmap_name + ".svg").c_str(), "px", 96.0f, replaces);
}
else {
std::map<std::string, std::string> temp_replaces;
image = nsvgParseFromFileWithReplace(Slic3r::var(bitmap_name + ".svg").c_str(), "px", 96.0f, temp_replaces);
}
if (image == nullptr)
return nullptr;