mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-04 06:11:02 +00:00
fix: Linux Flatpak freeze and blank toolpaths after changing a setting in Preview (#16109)
This commit is contained in:
@@ -2491,7 +2491,7 @@ void GLCanvas3D::render_thumbnail(ThumbnailData & thumbnail_data,
|
||||
|
||||
bool GLCanvas3D::_set_shown_canvas_current()
|
||||
{
|
||||
// Thumbnails also render outside render(), where another library's GL context (e.g. WebKitGTK's) can be current.
|
||||
// Called before GL work outside render(), where another library's GL context (e.g. WebKitGTK's) can be current.
|
||||
// Inside render(), the shown canvas is the one already bound.
|
||||
return wxGetApp().plater()->get_current_canvas3D()->_set_current();
|
||||
}
|
||||
@@ -3329,6 +3329,7 @@ void GLCanvas3D::load_shells(const Print& print, bool force_previewing)
|
||||
{
|
||||
if (m_initialized)
|
||||
{
|
||||
_set_shown_canvas_current();
|
||||
m_gcode_viewer.load_shells(print, m_initialized, force_previewing);
|
||||
m_gcode_viewer.update_shells_color_by_extruder(m_config);
|
||||
}
|
||||
@@ -3345,6 +3346,8 @@ void GLCanvas3D::load_gcode_preview(const GCodeProcessorResult& gcode_result, co
|
||||
PartPlate* plate = partplate_list.get_curr_plate();
|
||||
const std::vector<BoundingBoxf3>& exclude_bounding_box = plate->get_exclude_areas();
|
||||
|
||||
_set_shown_canvas_current();
|
||||
|
||||
//BBS: init is called in GLCanvas3D.render()
|
||||
//when load gcode directly, it is too late
|
||||
m_gcode_viewer.init(wxGetApp().get_mode(), wxGetApp().preset_bundle);
|
||||
|
||||
@@ -912,7 +912,7 @@ public:
|
||||
//BBS
|
||||
GCodeViewer& get_gcode_viewer() { return m_gcode_viewer; }
|
||||
void init_gcode_viewer(ConfigOptionMode mode, Slic3r::PresetBundle* preset_bundle) { m_gcode_viewer.init(mode, preset_bundle); }
|
||||
void reset_gcode_toolpaths() { m_gcode_viewer.reset(); }
|
||||
void reset_gcode_toolpaths() { _set_shown_canvas_current(); m_gcode_viewer.reset(); }
|
||||
const GCodeViewer::SequentialView& get_gcode_sequential_view() const { return m_gcode_viewer.get_sequential_view(); }
|
||||
void update_gcode_sequential_view_current(unsigned int first, unsigned int last) { m_gcode_viewer.update_sequential_view_current(first, last); }
|
||||
const libvgcode::Interval& get_gcode_view_full_range() const { return m_gcode_viewer.get_gcode_view_full_range(); }
|
||||
|
||||
Reference in New Issue
Block a user