* 拖拽panel修正

This commit is contained in:
2025-09-20 16:28:52 +08:00
parent 5dafd49cef
commit dc51023a31
4 changed files with 17 additions and 2 deletions
+1 -1
View File
@@ -211,7 +211,7 @@ private:
}
private:
// 可使用的节点内存
std::list<void*> _listFree;
std::list<void*> _listFree; // TODO 可改为vector
std::list<void*> _listUsed;
// 回调
std::function<void()> _cbDelete;
+1
View File
@@ -15,6 +15,7 @@ namespace dl::Tool
_panel->SetSize({ 600, 400 });
_panel->SetPosScale({ 0.5f, 0.5f });
_panel->SetAlign(Align::CC);
_panel->SetDebugName("DL Tool Manager");
{
UI::Background* bg = g_ui->CreateBackgroundDefault();
bg->SetSize({ 600, 400 });
+4 -1
View File
@@ -439,11 +439,14 @@ void Panel::_update_cpt_drag(Components* cpt)
if (get_coor)
coor = get_coor->Call();
}
Position pos_pre = coor->GetPosition();
drag->Update(coor, cpt_pickup->Call());
Position pos_dt = coor->GetPosition() - pos_pre;
if (drag->_bControlPanel)
{
_posPixel += drag->_posMove;
_posPixel += pos_dt;
log_info("拖拽:{} dt {}", to_string(_posPixel), to_string(pos_dt));
}
}
+11
View File
@@ -590,6 +590,13 @@ public:
UI::Text* ExGetText(size_t n = 0, bool show_log = true);
//! 设置第n个text内容
void ExSetString(std::string_view str, size_t n = 0);
void SetDebugName(std::string_view name)
{
#ifndef NDEBUG
_debugName = name;
#endif
}
private:
Panel() :
_order{ Z_DEFAULT_PANEL },
@@ -628,6 +635,10 @@ private:
}
delete _coor;
}
#ifndef NDEBUG
std::string _debugName;
#endif
// 添加到 Scene时自动设置
std::string _name;
std::vector<Components*> _allEle;// 子元素