impr: Improve handling of floating tool windows
This commit is contained in:
parent
a844fb3731
commit
aaaa02dbd0
@ -47,7 +47,7 @@ namespace hex::plugin::builtin {
|
||||
const float CircleRadius = 5_scaled;
|
||||
const float Gap = 1_scaled;
|
||||
|
||||
constexpr static auto func = [](u32 x, u32 y, float t) {
|
||||
constexpr static auto func = [](i32 x, i32 y, float t) {
|
||||
return std::sin(t - std::sqrt(std::pow((x - 14), 2) + std::pow((y - 8), 2)));
|
||||
};
|
||||
|
||||
|
@ -57,12 +57,7 @@ namespace hex::plugin::builtin {
|
||||
if (!detached) continue;
|
||||
|
||||
// Create a new window for the tool
|
||||
if (ImGui::Begin(View::toWindowName(name).c_str(), &detached, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize)) {
|
||||
if (!ImGui::IsWindowDocked())
|
||||
ImGui::SetWindowSize(scaled(ImVec2(600, 0)));
|
||||
|
||||
ImGui::BringWindowToDisplayFront(ImGui::GetCurrentWindow());
|
||||
|
||||
if (ImGui::Begin(View::toWindowName(name).c_str(), &detached, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize)) {
|
||||
// Draw the tool
|
||||
function();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user