diff --git a/src/slic3r/GUI/Printer/PrinterFileSystem.cpp b/src/slic3r/GUI/Printer/PrinterFileSystem.cpp index 9ca53e2fb..b0943f247 100644 --- a/src/slic3r/GUI/Printer/PrinterFileSystem.cpp +++ b/src/slic3r/GUI/Printer/PrinterFileSystem.cpp @@ -73,7 +73,7 @@ PrinterFileSystem::PrinterFileSystem() wxString path = "D:\\work\\pic\\"; for (int i = 0; i < 10; ++i) { auto name = wxString::Format(L"gcode-%02d.3mf", i + 1); - m_file_list.push_back({name.ToUTF8().data(), "", time.GetTicks(), 26937, i < 5 ? FF_DOWNLOAD : 0, default_thumbnail, i * 34 - 35}); + m_file_list.push_back({name.ToUTF8().data(), "", time.GetTicks(), 26937, i < 5 ? FF_DOWNLOAD : 0, default_thumbnail}); std::ifstream ifs((path + name).ToUTF8().data(), std::ios::binary); if (ifs) ParseThumbnail(m_file_list.back(), ifs); @@ -84,7 +84,7 @@ PrinterFileSystem::PrinterFileSystem() for (int i = 0; i < 100; ++i) { auto name = wxString::Format(L"img-%03d.jpg", i + 1); wxImage im(path + name); - m_file_list.push_back({name.ToUTF8().data(), "", time.GetTicks(), 26937, i < 20 ? FF_DOWNLOAD : 0, i > 3 ? im : default_thumbnail, i * 10 - 40 - 1}); + m_file_list.push_back({name.ToUTF8().data(), "", time.GetTicks(), 26937, i < 20 ? FF_DOWNLOAD : 0, i > 3 ? im : default_thumbnail}); time.Add(wxDateSpan::Days(-1)); } m_file_list[0].thumbnail = default_thumbnail; @@ -958,13 +958,13 @@ void PrinterFileSystem::FileRemoved(std::pair type, size_ if (file_index.second == size_t(-1)) return; if (&file_index.first == &m_file_list) { - auto removeFromGroup = [](std::vector &group, size_t index, int total) { + auto removeFromGroup = [](std::vector &group, size_t index, size_t total) { for (auto iter = group.begin(); iter != group.end(); ++iter) { size_t index2 = -1; if (*iter < index) continue; if (*iter == index) { auto iter2 = iter + 1; - if (iter2 == group.end() ? index == total - 1 : *iter2 == index + 1) { + if (index + 1 == (iter2 == group.end() ? total : *iter2)) { index2 = std::distance(group.begin(), iter); } ++iter; @@ -978,11 +978,11 @@ void PrinterFileSystem::FileRemoved(std::pair type, size_ }; size_t index2 = removeFromGroup(m_group_month, index, m_file_list.size()); if (index2 < m_group_month.size()) { - int index3 = removeFromGroup(m_group_year, index, m_group_month.size()); + int index3 = removeFromGroup(m_group_year, index2, m_group_month.size()); if (index3 < m_group_year.size()) { m_group_year.erase(m_group_year.begin() + index3); if (m_group_mode == G_YEAR) - m_group_flags.erase(m_group_flags.begin() + index2); + m_group_flags.erase(m_group_flags.begin() + index3); } m_group_month.erase(m_group_month.begin() + index2); if (m_group_mode == G_MONTH) diff --git a/src/slic3r/GUI/wxMediaCtrl2.cpp b/src/slic3r/GUI/wxMediaCtrl2.cpp index 9400f8a6c..60b026733 100644 --- a/src/slic3r/GUI/wxMediaCtrl2.cpp +++ b/src/slic3r/GUI/wxMediaCtrl2.cpp @@ -55,6 +55,7 @@ wxMediaCtrl2::wxMediaCtrl2(wxWindow *parent) void wxMediaCtrl2::Load(wxURI url) { #ifdef __WIN32__ + InvalidateBestSize(); if (m_imp == nullptr) { static bool notified = false; if (!notified) CallAfter([] {