From 34b504d50edbcd30d7ceb91059a3ca1abab17fb7 Mon Sep 17 00:00:00 2001 From: dakkar Date: Mon, 6 Apr 2020 12:48:33 +0100 Subject: [PATCH] avoid calling GetHeight() on non-IsOk() icons probably fixes #3837 --- src/slic3r/GUI/ObjectDataViewModel.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/ObjectDataViewModel.cpp b/src/slic3r/GUI/ObjectDataViewModel.cpp index 0905f4915..d9b9af016 100644 --- a/src/slic3r/GUI/ObjectDataViewModel.cpp +++ b/src/slic3r/GUI/ObjectDataViewModel.cpp @@ -1710,10 +1710,11 @@ bool BitmapChoiceRenderer::Render(wxRect rect, wxDC* dc, int state) { dc->DrawBitmap(icon, rect.x, rect.y + (rect.height - icon.GetHeight()) / 2); xoffset = icon.GetWidth() + 4; + + if (rect.height==0) + rect.height= icon.GetHeight(); } - if (rect.height==0) - rect.height= icon.GetHeight(); RenderText(m_value.GetText(), xoffset, rect, dc, state); return true;