Make cutscene editor dock properly
This commit is contained in:
parent
71fe041691
commit
4ce486b0bc
1 changed files with 8 additions and 4 deletions
|
@ -30,6 +30,8 @@ void app_main(prism::engine* engine) {
|
|||
|
||||
CutsceneEditor::CutsceneEditor() : CommonEditor("CutsceneEditor") {}
|
||||
|
||||
static bool has_been_docked = false;
|
||||
|
||||
void CutsceneEditor::drawUI() {
|
||||
createDockArea();
|
||||
|
||||
|
@ -37,7 +39,7 @@ void CutsceneEditor::drawUI() {
|
|||
|
||||
ImGui::End();
|
||||
|
||||
if(ImGui::DockBuilderGetNode(editor_dockspace) == nullptr) {
|
||||
if(!has_been_docked) {
|
||||
const auto size = ImGui::GetMainViewport()->Size;
|
||||
|
||||
ImGui::DockBuilderRemoveNode(editor_dockspace);
|
||||
|
@ -67,6 +69,8 @@ void CutsceneEditor::drawUI() {
|
|||
ImGui::DockBuilderDockWindow("Animation Editor", lowerbar);
|
||||
|
||||
ImGui::DockBuilderFinish(editor_dockspace);
|
||||
|
||||
has_been_docked =true;
|
||||
}
|
||||
|
||||
if (ImGui::BeginMainMenuBar())
|
||||
|
|
Reference in a new issue