mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-15 03:05:57 +08:00
Fixed size of scale 3d gizmo reference box
This commit is contained in:
parent
00b10c7f9d
commit
0f4a2ee69a
@ -693,6 +693,7 @@ void GLGizmoRotate3D::on_render(const BoundingBoxf3& box) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
const float GLGizmoScale3D::Offset = 5.0f;
|
const float GLGizmoScale3D::Offset = 5.0f;
|
||||||
|
const Vec3d GLGizmoScale3D::OffsetVec = (double)GLGizmoScale3D::Offset * Vec3d::Ones();
|
||||||
|
|
||||||
GLGizmoScale3D::GLGizmoScale3D(GLCanvas3D& parent)
|
GLGizmoScale3D::GLGizmoScale3D(GLCanvas3D& parent)
|
||||||
: GLGizmoBase(parent)
|
: GLGizmoBase(parent)
|
||||||
@ -742,7 +743,7 @@ void GLGizmoScale3D::on_start_dragging(const BoundingBoxf3& box)
|
|||||||
{
|
{
|
||||||
m_starting_drag_position = m_grabbers[m_hover_id].center;
|
m_starting_drag_position = m_grabbers[m_hover_id].center;
|
||||||
m_show_starting_box = true;
|
m_show_starting_box = true;
|
||||||
m_starting_box = box;
|
m_starting_box = BoundingBoxf3(box.min - OffsetVec, box.max + OffsetVec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -776,9 +777,7 @@ void GLGizmoScale3D::on_render(const BoundingBoxf3& box) const
|
|||||||
|
|
||||||
::glEnable(GL_DEPTH_TEST);
|
::glEnable(GL_DEPTH_TEST);
|
||||||
|
|
||||||
Vec3d offset_vec = (double)Offset * Vec3d::Ones();
|
m_box = BoundingBoxf3(box.min - OffsetVec, box.max + OffsetVec);
|
||||||
|
|
||||||
m_box = BoundingBoxf3(box.min - offset_vec, box.max + offset_vec);
|
|
||||||
const Vec3d& center = m_box.center();
|
const Vec3d& center = m_box.center();
|
||||||
|
|
||||||
// x axis
|
// x axis
|
||||||
|
@ -235,6 +235,7 @@ protected:
|
|||||||
class GLGizmoScale3D : public GLGizmoBase
|
class GLGizmoScale3D : public GLGizmoBase
|
||||||
{
|
{
|
||||||
static const float Offset;
|
static const float Offset;
|
||||||
|
static const Vec3d OffsetVec;
|
||||||
|
|
||||||
mutable BoundingBoxf3 m_box;
|
mutable BoundingBoxf3 m_box;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user