TyomaVader / ImGuiNotify

A (very) simple notification wrapper for Dear ImGui
MIT License
76 stars 7 forks source link

Rendering issue with notification width #2

Open araid opened 10 months ago

araid commented 10 months ago

Hi there! Thanks for the updates to this repo, I just started using your fork in a macOS project.

I noticed that, the first times a new notification is created, the width of the notification is incorrect for a frame or two. You can see it in your demo video around second 4, when you add Warning notifications.

EDIT I think the issue is reusing window names in sprintf(windowName, "##TOAST%d", (int)i);, which confuses ImGui. It'd be better to assign a unique id to each new toast and update that with sprintf(windowName, "##TOAST%d", currentToast->getId());

TyomaVader commented 10 months ago

Thanks, I'll look into it, this is part of the original code by @patrickcjk, so I might have missed that

TyomaVader commented 10 months ago

EDIT I think the issue is reusing window names in sprintf(windowName, "##TOAST%d", (int)i);, which confuses ImGui. It'd be better to assign a unique id to each new toast and update that with sprintf(windowName, "##TOAST%d", currentToast->getId());

I've checked your assumption using ImGui::ShowStackToolWindow(), but unfortunately it seems like all window ids are unique. It might be an autoresize issue, I'll let you know, if I find some fix.