1
0
mirror of synced 2024-11-24 15:50:16 +01:00

impr: Improve handling of floating tool windows

This commit is contained in:
WerWolv 2023-12-18 08:58:00 +01:00
parent a844fb3731
commit aaaa02dbd0
2 changed files with 2 additions and 7 deletions

View File

@ -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)));
};

View File

@ -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();