Skip to content

Commit

Permalink
Correct UI calculations in camera tab
Browse files Browse the repository at this point in the history
  • Loading branch information
chirpxiv committed Jun 14, 2023
1 parent 8e7d5da commit 1b359ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Ktisis/Interface/Windows/Workspace/Tabs/CameraTab.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ private static void DrawCameraSelect() {

var avail = ImGui.GetContentRegionAvail().X;
var style = ImGui.GetStyle();

var plusSize = GuiHelpers.CalcIconSize(FontAwesomeIcon.Plus);
var camSize = GuiHelpers.CalcIconSize(FontAwesomeIcon.Camera);

Expand All @@ -92,7 +92,7 @@ private static void DrawCameraSelect() {
var isFreecam = camera.WorkCamera != null;
ImGui.BeginDisabled(isFreecam);

var comboWidth = avail - (style.ItemSpacing.X * 4) + style.ItemInnerSpacing.X - plusSize.X - camSize.X;
var comboWidth = avail - style.ItemSpacing.X - (style.FramePadding.X * 4) - plusSize.X - camSize.X - 5;
ImGui.SetNextItemWidth(comboWidth);
if (ImGui.BeginCombo("##CameraSelect", camera.Name)) {
var size = ImGui.GetItemRectSize();
Expand Down Expand Up @@ -139,7 +139,7 @@ private static void DrawCameraSelect() {
EditingId = null;
}

ImGui.SameLine(ImGui.GetCursorPosX() + comboWidth + style.ItemInnerSpacing.X);
ImGui.SameLine(ImGui.GetCursorPosX() + comboWidth + 5);
var createNew = GuiHelpers.IconButtonTooltip(FontAwesomeIcon.Plus, "Create new camera");
if (createNew) {
Services.Framework.RunOnFrameworkThread(() => {
Expand Down

0 comments on commit 1b359ca

Please sign in to comment.