fix floating drop
This commit is contained in:
@@ -167,8 +167,12 @@ kEventResult NodePanelFloating::handle_event(Event* e)
|
||||
m_dragging = false;
|
||||
if (m_action == kDragAction::Move)
|
||||
{
|
||||
glm::vec2 outline_pos(0);
|
||||
if (m_outline)
|
||||
{
|
||||
outline_pos = m_outline->m_pos;
|
||||
m_outline->destroy();
|
||||
}
|
||||
int drop_pos = 0;
|
||||
if (m_drop_placeholder)
|
||||
{
|
||||
@@ -204,7 +208,7 @@ kEventResult NodePanelFloating::handle_event(Event* e)
|
||||
{
|
||||
auto cont = root()->find("floatings");
|
||||
SetPositioning(YGPositionTypeAbsolute);
|
||||
auto newpos = glm::clamp(m_outline->m_pos - cont->m_pos, { 0, 0 }, cont->m_size - m_size);
|
||||
auto newpos = glm::clamp(outline_pos - cont->m_pos, { 0, 0 }, cont->m_size - m_size);
|
||||
SetPosition(newpos);
|
||||
cont->add_child(ref);
|
||||
m_dock.reset();
|
||||
|
||||
Reference in New Issue
Block a user