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 Vec3d GLGizmoScale3D::OffsetVec = (double)GLGizmoScale3D::Offset * Vec3d::Ones();
|
||||
|
||||
GLGizmoScale3D::GLGizmoScale3D(GLCanvas3D& 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_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);
|
||||
|
||||
Vec3d offset_vec = (double)Offset * Vec3d::Ones();
|
||||
|
||||
m_box = BoundingBoxf3(box.min - offset_vec, box.max + offset_vec);
|
||||
m_box = BoundingBoxf3(box.min - OffsetVec, box.max + OffsetVec);
|
||||
const Vec3d& center = m_box.center();
|
||||
|
||||
// x axis
|
||||
|
@ -235,6 +235,7 @@ protected:
|
||||
class GLGizmoScale3D : public GLGizmoBase
|
||||
{
|
||||
static const float Offset;
|
||||
static const Vec3d OffsetVec;
|
||||
|
||||
mutable BoundingBoxf3 m_box;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user