mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
Generate gizmos' tooltip on demand
This commit is contained in:
parent
ffe404fc5b
commit
a0ed240af1
10 changed files with 83 additions and 78 deletions
|
@ -30,6 +30,11 @@ GLGizmoCut::GLGizmoCut(GLCanvas3D& parent, const std::string& icon_filename, uns
|
|||
, m_rotate_lower(false)
|
||||
{}
|
||||
|
||||
std::string GLGizmoCut::get_tooltip() const
|
||||
{
|
||||
return (m_hover_id == 0 || m_grabbers[0].dragging) ? "Z: " + format(m_cut_z, 2) : "";
|
||||
}
|
||||
|
||||
bool GLGizmoCut::on_init()
|
||||
{
|
||||
m_grabbers.emplace_back();
|
||||
|
@ -79,9 +84,6 @@ void GLGizmoCut::on_update(const UpdateData& data)
|
|||
|
||||
void GLGizmoCut::on_render() const
|
||||
{
|
||||
if (m_hover_id == 0 || m_grabbers[0].dragging)
|
||||
set_tooltip("Z: " + format(m_cut_z, 2));
|
||||
|
||||
const Selection& selection = m_parent.get_selection();
|
||||
|
||||
update_max_z(selection);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue