Compare commits
2 Commits
a8f14b8f81
...
4985e498e6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4985e498e6 | ||
|
|
2e95908242 |
@ -452,7 +452,7 @@ int main(int, char**)
|
|||||||
init();
|
init();
|
||||||
|
|
||||||
// Main loop
|
// Main loop
|
||||||
while (!glfwWindowShouldClose(window))
|
while (!glfwWindowShouldClose(window) && !should_exit)
|
||||||
{
|
{
|
||||||
// Poll and handle events (inputs, window resize, etc.)
|
// Poll and handle events (inputs, window resize, etc.)
|
||||||
// You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.
|
// You can read the io.WantCaptureMouse, io.WantCaptureKeyboard flags to tell if dear imgui wants to use your inputs.
|
||||||
|
|||||||
@ -485,6 +485,18 @@ void per_frame(){
|
|||||||
|
|
||||||
ImGui::TableSetColumnIndex(3);
|
ImGui::TableSetColumnIndex(3);
|
||||||
if (ImGui::Button("d")) {
|
if (ImGui::Button("d")) {
|
||||||
|
for (size_t j = 0; j < num_categorized_days; j++) {
|
||||||
|
// Remove categorized days that have the to be deleted category
|
||||||
|
if (categorized_days[j].category == i) {
|
||||||
|
for (size_t k = j; k < num_categorized_days - 1; k++) categorized_days[k] = categorized_days[k + 1];
|
||||||
|
num_categorized_days--;
|
||||||
|
j--;
|
||||||
|
}
|
||||||
|
// Decrement the category index of all categorized days that have an index higher than the one to be removed
|
||||||
|
if (categorized_days[j].category > i) categorized_days[j].category--;
|
||||||
|
}
|
||||||
|
// Remove the category
|
||||||
|
for (size_t j = i; j < num_categories - 1; j++) categories[j] = categories[j + 1];
|
||||||
num_categories--;
|
num_categories--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user