mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 16:45:53 +08:00
Fixed scaling of multipart objects using the sidebar panel
This commit is contained in:
parent
deefe1b2e9
commit
646af02560
@ -1416,14 +1416,9 @@ void Selection::scale_and_translate(const Vec3d& scale, const Vec3d& translation
|
|||||||
if (!m_valid)
|
if (!m_valid)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (unsigned int i : m_list) {
|
|
||||||
GLVolume& v = *(*m_volumes)[i];
|
|
||||||
const VolumeCache& volume_data = m_cache.volumes_data[i];
|
|
||||||
const Geometry::Transformation& inst_trafo = volume_data.get_instance_transform();
|
|
||||||
|
|
||||||
Vec3d relative_scale = scale;
|
Vec3d relative_scale = scale;
|
||||||
|
|
||||||
if (transformation_type.absolute()) {
|
if (transformation_type.absolute()) {
|
||||||
|
// converts to relative scale
|
||||||
if (m_mode == Instance) {
|
if (m_mode == Instance) {
|
||||||
if (is_single_full_instance()) {
|
if (is_single_full_instance()) {
|
||||||
BoundingBoxf3 current_box = get_bounding_box_in_current_reference_system().first;
|
BoundingBoxf3 current_box = get_bounding_box_in_current_reference_system().first;
|
||||||
@ -1436,11 +1431,14 @@ void Selection::scale_and_translate(const Vec3d& scale, const Vec3d& translation
|
|||||||
relative_scale = original_box.size().cwiseProduct(scale).cwiseQuotient(current_box.size());
|
relative_scale = original_box.size().cwiseProduct(scale).cwiseQuotient(current_box.size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
}
|
|
||||||
transformation_type.set_relative();
|
transformation_type.set_relative();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (unsigned int i : m_list) {
|
||||||
|
GLVolume& v = *(*m_volumes)[i];
|
||||||
|
const VolumeCache& volume_data = m_cache.volumes_data[i];
|
||||||
|
const Geometry::Transformation& inst_trafo = volume_data.get_instance_transform();
|
||||||
|
|
||||||
if (m_mode == Instance) {
|
if (m_mode == Instance) {
|
||||||
if (transformation_type.instance()) {
|
if (transformation_type.instance()) {
|
||||||
const Vec3d world_inst_pivot = m_cache.dragging_center - inst_trafo.get_offset();
|
const Vec3d world_inst_pivot = m_cache.dragging_center - inst_trafo.get_offset();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user