From 49673b56e3a6ade665acafa2c073ccdce3eddc3a Mon Sep 17 00:00:00 2001 From: "zhimin.zeng" Date: Thu, 5 Jan 2023 14:04:36 +0800 Subject: [PATCH] FIX: the text position is not correct Change-Id: Icade50bd8246d051f6c8368f2be89654cb96c9d9 (cherry picked from commit a39d7ffb377c53aa85264e8196e47b176479544a) --- src/slic3r/GUI/GUI_ObjectList.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp index d83187a81..79b8eae52 100644 --- a/src/slic3r/GUI/GUI_ObjectList.cpp +++ b/src/slic3r/GUI/GUI_ObjectList.cpp @@ -2179,9 +2179,9 @@ void ObjectList::load_mesh_part(const TriangleMesh &mesh, const wxString &name, // apply the instance transform to all volumes and reset instance transform except the offset apply_object_instance_transfrom_to_all_volumes(mo); + double old_top_position = mo->mesh().bounding_box().max(2) - mo->instances[0]->get_offset().z(); ModelVolume* mv = mo->add_volume(mesh); - Vec3d instance_bbox = mo->mesh().bounding_box().size(); - Vec3d offset = Vec3d(0, 0, instance_bbox[2] / 2 + mv->get_offset(Axis::Z)); + Vec3d offset = Vec3d(0, 0, old_top_position + mv->get_offset(Axis::Z)); mv->set_offset(offset); mv->name = name.ToStdString(); if (!text_info.m_text.empty())