Fixed conflicts after merge with master

This commit is contained in:
enricoturri1966 2021-05-20 15:37:56 +02:00
commit d13c550968
8 changed files with 73 additions and 8 deletions

View file

@ -914,7 +914,7 @@ void its_collect_mesh_projection_points_above(const indexed_triangle_set &its, c
float t = (z - p1.z()) / (p2.z() - p1.z());
all_pts.emplace_back(scaled<coord_t>(p1.x() + (p2.x() - p1.x()) * t), scaled<coord_t>(p1.y() + (p2.y() - p1.y()) * t));
}
if (p2.z() > z)
if (p2.z() >= z)
all_pts.emplace_back(scaled<coord_t>(p2.x()), scaled<coord_t>(p2.y()));
iprev = iedge;
}

View file

@ -596,7 +596,7 @@ void GCodeViewer::load(const GCodeProcessor::Result& gcode_result, const Print&
m_last_result_id = gcode_result.id;
// release gpu memory, if used
reset();
reset();
#if ENABLE_GCODE_WINDOW
m_sequential_view.gcode_window.set_filename(gcode_result.filename);

View file

@ -4621,6 +4621,14 @@ void GLCanvas3D::_resize(unsigned int w, unsigned int h)
if (m_canvas == nullptr && m_context == nullptr)
return;
#if ENABLE_SCROLLABLE_LEGEND
const std::array<unsigned int, 2> new_size = { w, h };
if (m_old_size == new_size)
return;
m_old_size = new_size;
#endif // ENABLE_SCROLLABLE_LEGEND
auto *imgui = wxGetApp().imgui();
imgui->set_display_size(static_cast<float>(w), static_cast<float>(h));
const float font_size = 1.5f * wxGetApp().em_unit();

View file

@ -425,6 +425,10 @@ private:
Model* m_model;
BackgroundSlicingProcess *m_process;
#if ENABLE_SCROLLABLE_LEGEND
std::array<unsigned int, 2> m_old_size{ 0, 0 };
#endif // ENABLE_SCROLLABLE_LEGEND
// Screen is only refreshed from the OnIdle handler if it is dirty.
bool m_dirty;
bool m_initialized;
@ -756,6 +760,10 @@ public:
const Print* fff_print() const;
const SLAPrint* sla_print() const;
#if ENABLE_SCROLLABLE_LEGEND
void reset_old_size() { m_old_size = { 0, 0 }; }
#endif // ENABLE_SCROLLABLE_LEGEND
private:
bool _is_shown_on_screen() const;

View file

@ -6,6 +6,7 @@
#include "PrintHostDialogs.hpp"
#include "wxExtensions.hpp"
#include "../Utils/PrintHost.hpp"
#include "libslic3r/Config.hpp"
#include <boost/algorithm/string.hpp>
#include <boost/log/trivial.hpp>
@ -304,8 +305,8 @@ void NotificationManager::PopNotification::count_lines()
}
// hypertext calculation
if (!m_hypertext.empty()) {
int prev_end = m_endlines.size() > 1 ? m_endlines[m_endlines.size() - 2] : 0;
if (ImGui::CalcTextSize((text.substr(prev_end, last_end - prev_end) + m_hypertext).c_str()).x > m_window_width - m_window_width_offset) {
int prev_end = m_endlines.size() > 1 ? m_endlines[m_endlines.size() - 2] : 0; // m_endlines.size() - 2 because we are fitting hypertext instead of last endline
if (ImGui::CalcTextSize((escape_string_cstyle(text.substr(prev_end, last_end - prev_end)) + m_hypertext).c_str()).x > m_window_width - m_window_width_offset) {
m_endlines.push_back(last_end);
m_lines_count++;
}
@ -366,7 +367,7 @@ void NotificationManager::PopNotification::render_text(ImGuiWrapper& imgui, cons
}
//hyperlink text
if (!m_hypertext.empty()) {
render_hypertext(imgui, x_offset + ImGui::CalcTextSize((line + " ").c_str()).x, starting_y + (m_lines_count - 1) * shift_y, m_hypertext);
render_hypertext(imgui, x_offset + ImGui::CalcTextSize((line + (line.empty() ? "" : " ")).c_str()).x, starting_y + (m_lines_count - 1) * shift_y, m_hypertext);
}

View file

@ -3452,8 +3452,12 @@ void Plater::priv::set_current_panel(wxPanel* panel)
// sets the canvas as dirty to force a render at the 1st idle event (wxWidgets IsShownOnScreen() is buggy and cannot be used reliably)
view3D->set_as_dirty();
#if ENABLE_SCROLLABLE_LEGEND
// reset cached size to force a resize on next call to render() to keep imgui in synch with canvas size
view3D->get_canvas3d()->reset_old_size();
#endif // ENABLE_SCROLLABLE_LEGEND
view_toolbar.select_item("3D");
if(notification_manager != nullptr)
if (notification_manager != nullptr)
notification_manager->set_in_preview(false);
}
else if (current_panel == preview) {
@ -3472,6 +3476,10 @@ void Plater::priv::set_current_panel(wxPanel* panel)
preview->reload_print(true);
preview->set_as_dirty();
#if ENABLE_SCROLLABLE_LEGEND
// reset cached size to force a resize on next call to render() to keep imgui in synch with canvas size
preview->get_canvas3d()->reset_old_size();
#endif // ENABLE_SCROLLABLE_LEGEND
view_toolbar.select_item("Preview");
if (notification_manager != nullptr)
notification_manager->set_in_preview(true);