mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 03:43:52 +00:00
FIX: Prevent crash when rendering color button on linux
jira: none Change-Id: I8758c3a352bd206ff81ce72ed0ad902f8a79c30e (cherry picked from commit 45818c4e762b540feb0a67d117b595eb589e8058)
This commit is contained in:
@@ -686,10 +686,13 @@ wxBitmap *get_extruder_color_icon(std::string color, std::string label, int icon
|
|||||||
#ifdef __WXOSX__
|
#ifdef __WXOSX__
|
||||||
bitmap->UseAlpha();
|
bitmap->UseAlpha();
|
||||||
wxMemoryDC dc(*bitmap);
|
wxMemoryDC dc(*bitmap);
|
||||||
#else
|
#elif defined(__WXMSW__)
|
||||||
wxClientDC cdc((wxWindow *) Slic3r::GUI::wxGetApp().mainframe);
|
wxClientDC cdc((wxWindow *) Slic3r::GUI::wxGetApp().mainframe);
|
||||||
wxMemoryDC dc(&cdc);
|
wxMemoryDC dc(&cdc);
|
||||||
dc.SelectObject(*bitmap);
|
dc.SelectObject(*bitmap);
|
||||||
|
#else
|
||||||
|
wxMemoryDC dc;
|
||||||
|
dc.SelectObject(*bitmap);
|
||||||
#endif
|
#endif
|
||||||
dc.SetFont(::Label::Body_12);
|
dc.SetFont(::Label::Body_12);
|
||||||
Slic3r::GUI::WxFontUtils::get_suitable_font_size(icon_height - 2, dc);
|
Slic3r::GUI::WxFontUtils::get_suitable_font_size(icon_height - 2, dc);
|
||||||
|
|||||||
Reference in New Issue
Block a user