From 82dc6b000a2f39aa0e5d20f44ef5c6c96f2870c6 Mon Sep 17 00:00:00 2001 From: Joey Pollack Date: Thu, 6 Oct 2022 16:52:51 -0400 Subject: [PATCH] Components can be removed --- src/run_modes/editor/component_guis.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/run_modes/editor/component_guis.cpp b/src/run_modes/editor/component_guis.cpp index 3123aef..1fe78fc 100644 --- a/src/run_modes/editor/component_guis.cpp +++ b/src/run_modes/editor/component_guis.cpp @@ -15,10 +15,6 @@ namespace lunarium { namespace editor { - // TODO: Add an X button on the right of the title line to remove components - // Will need to have the functions return a bool indicating when this - // button is pressed - ///////////////////////////////////////////////////////////////////// // COMMON SECTIONS ///////////////////////////////////////////////////////////////////// @@ -33,6 +29,9 @@ namespace lunarium { namespace editor ImGui::SameLine(); std::string label = "X##"; label += title; + float x = ImGui::GetCursorPosX(); + x += ImGui::GetContentRegionAvail().x; + ImGui::SetCursorPosX(x - 25); return ImGui::Button(label.c_str()); }