diff --git a/src/slic3r/GUI/3DBed.cpp b/src/slic3r/GUI/3DBed.cpp index 9d73383096..5c843f4cbe 100644 --- a/src/slic3r/GUI/3DBed.cpp +++ b/src/slic3r/GUI/3DBed.cpp @@ -246,7 +246,7 @@ void Bed3D::Axes::render() //BBS: add part plate logic bool Bed3D::set_shape(const Pointfs& printable_area, const double printable_height, const std::string& custom_model, bool force_as_custom, - const Vec2d position, bool with_reset) + const Vec2d& position, bool with_reset) { /*auto check_texture = [](const std::string& texture) { boost::system::error_code ec; // so the exists call does not throw (e.g. after a permission problem) @@ -612,7 +612,7 @@ void Bed3D::render_system(GLCanvas3D& canvas, const Transform3d& view_matrix, co void Bed3D::update_model_offset() { // move the model so that its origin (0.0, 0.0, 0.0) goes into the bed shape center and a bit down to avoid z-fighting with the texture quad - Vec3d shift = m_extended_bounding_box.center(); + Vec3d shift = m_build_volume.bounding_volume().center(); shift(2) = -0.03; Vec3d* model_offset_ptr = const_cast(&m_model_offset); *model_offset_ptr = shift; diff --git a/src/slic3r/GUI/3DBed.hpp b/src/slic3r/GUI/3DBed.hpp index ed19e24b53..1f3d3aab8a 100644 --- a/src/slic3r/GUI/3DBed.hpp +++ b/src/slic3r/GUI/3DBed.hpp @@ -121,7 +121,7 @@ public: // as this class does not use it, thus there is no need to update the UI. // BBS bool set_shape(const Pointfs& printable_area, const double printable_height, const std::string& custom_model, bool force_as_custom = false, - const Vec2d position = Vec2d::Zero(), bool with_reset = true); + const Vec2d& position = Vec2d::Zero(), bool with_reset = true); void set_position(Vec2d& position); void set_axes_mode(bool origin); diff --git a/src/slic3r/GUI/PartPlate.hpp b/src/slic3r/GUI/PartPlate.hpp index fdc0fc18e3..675f004c93 100644 --- a/src/slic3r/GUI/PartPlate.hpp +++ b/src/slic3r/GUI/PartPlate.hpp @@ -692,11 +692,6 @@ public: m_height_limit_mode = mode; } - // SoftFever - const std::string& get_logo_texture_filename() const { - return m_logo_texture_filename; - } - int get_curr_plate_index() const { return m_current_plate; } PartPlate* get_curr_plate() { return m_plate_list[m_current_plate]; } const PartPlate* get_curr_plate() const { return m_plate_list[m_current_plate]; } diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 589a18aaa7..007b4943b3 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -8162,13 +8162,14 @@ void Plater::priv::set_bed_shape(const Pointfs& shape, const Pointfs& exclude_ar float prev_height_lid, prev_height_rod; partplate_list.get_height_limits(prev_height_lid, prev_height_rod); - auto prev_logo = partplate_list.get_logo_texture_filename(); double height_to_lid = config->opt_float("extruder_clearance_height_to_lid"); double height_to_rod = config->opt_float("extruder_clearance_height_to_rod"); - auto custom_bed_texture = config->opt_string("bed_custom_texture"); Pointfs prev_exclude_areas = partplate_list.get_exclude_area(); - new_shape |= (height_to_lid != prev_height_lid) || (height_to_rod != prev_height_rod) || (prev_exclude_areas != exclude_areas) || (prev_logo != custom_bed_texture); + new_shape |= (height_to_lid != prev_height_lid) || (height_to_rod != prev_height_rod) || (prev_exclude_areas != exclude_areas); + if (!new_shape && partplate_list.get_logo_texture_filename() != custom_texture) { + partplate_list.update_logo_texture_filename(custom_texture); + } if (new_shape) { if (view3D) view3D->bed_shape_changed(); if (preview) preview->bed_shape_changed();