Skip to content

Commit

Permalink
Fixed crop dialog positioning in fullscreen.
Browse files Browse the repository at this point in the history
  • Loading branch information
bluescan committed Feb 2, 2020
1 parent fc69c2d commit fff8883
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions Src/Crop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,18 +288,20 @@ void TexView::ShowCropPopup(const tVector4& lrtb, const tVector2& uvmarg, const
if (!CropMode)
return;

tVector2 windowPos = tVector2((lrtb.R+lrtb.L)/2.0f - 90.0f, 48.0f);
if (justOpened)
{
tVector2 windowPos = tVector2((lrtb.R+lrtb.L)/2.0f - 90.0f, 48.0f);
ImGui::SetNextWindowPos(windowPos);
}
ImGui::SetNextWindowSize(tVector2(174, 158), ImGuiCond_Always);
else
ImGui::SetNextWindowPos(windowPos, ImGuiCond_FirstUseEver);

ImGui::SetNextWindowSize(tVector2(180, 160), ImGuiCond_Always);
ImGui::SetNextWindowBgAlpha(0.70f);
ImGuiWindowFlags flags =
ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize |
ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing |
ImGuiWindowFlags_NoNav;


if (ImGui::Begin("Crop", &CropMode, flags))
{
tVector2 scrCropMin(CropGizmo.LineL.Get(), CropGizmo.LineB.Get());
Expand All @@ -319,21 +321,19 @@ void TexView::ShowCropPopup(const tVector4& lrtb, const tVector2& uvmarg, const
int margB = minY;
int margT = origH - maxY - 1;

float col = ImGui::GetCursorPosX() + 74.0f;
ImGui::Text("Lower Left"); ImGui::SameLine(); ImGui::SetCursorPosX(col); ImGui::Text("X:%d Y:%d", minX, minY);
ImGui::Text("Upper Right"); ImGui::SameLine(); ImGui::SetCursorPosX(col); ImGui::Text("X:%d Y:%d", maxX, maxY);

float col = ImGui::GetCursorPosX() + 70.0f;
ImGui::Text("Bot Left"); ImGui::SameLine(); ImGui::SetCursorPosX(col); ImGui::Text("X:%d Y:%d", minX, minY);
ImGui::Text("Top Right"); ImGui::SameLine(); ImGui::SetCursorPosX(col); ImGui::Text("X:%d Y:%d", maxX, maxY);
ImGui::Text("H Margins"); ImGui::SameLine(); ImGui::SetCursorPosX(col); ImGui::Text("L:%d R:%d", margL, margR);
ImGui::Text("V Margins"); ImGui::SameLine(); ImGui::SetCursorPosX(col); ImGui::Text("B:%d T:%d", margB, margT);
ImGui::Text("Orig Size"); ImGui::SameLine(); ImGui::SetCursorPosX(col); ImGui::Text("W:%d H:%d", origW, origH);
ImGui::Text("New Size"); ImGui::SameLine(); ImGui::SetCursorPosX(col); ImGui::Text("W:%d H:%d", newW, newH);
if ((maxX - minX + 1 < 4) || (maxY - minY + 1 < 4))
{
ImGui::SameLine();
ImGui::Text("Min 4x4");
}

ImGui::Text("H Margins"); ImGui::SameLine(); ImGui::SetCursorPosX(col); ImGui::Text("L:%d R:%d", margL, margR);
ImGui::Text("V Margins"); ImGui::SameLine(); ImGui::SetCursorPosX(col); ImGui::Text("B:%d T:%d", margB, margT);
ImGui::Text("Orig Size"); ImGui::SameLine(); ImGui::SetCursorPosX(col); ImGui::Text("W:%d H:%d", origW, origH);
ImGui::Text("New Size"); ImGui::SameLine(); ImGui::SetCursorPosX(col); ImGui::Text("W:%d H:%d", newW, newH);

ImGui::SetCursorPosY(ImGui::GetCursorPosY() + 7.0f);

if (ImGui::Button("Cancel", tVector2(64, 0)))
Expand Down

0 comments on commit fff8883

Please sign in to comment.