Skip to content

Commit

Permalink
Fix viewport offset on RecipeNote
Browse files Browse the repository at this point in the history
  • Loading branch information
WorkingRobot committed Nov 8, 2023
1 parent 9a490c1 commit f8c5f9c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Craftimizer/Windows/RecipeNote.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
| ImGuiWindowFlags.NoFocusOnAppearing
| ImGuiWindowFlags.NoNavFocus;

public enum CraftableStatus
public enum CraftableStatus
{
OK,
LockedClassJob,
Expand Down Expand Up @@ -71,7 +71,7 @@ public enum CraftableStatus
private IDalamudTextureWrap NoManipulationBadge { get; }
private GameFontHandle AxisFont { get; }

public RecipeNote() : base("Craftimizer RecipeNote", WindowFlags, false)
public RecipeNote() : base("Craftimizer RecipeNote", WindowFlags)
{
ExpertBadge = Service.IconManager.GetAssemblyTexture("Graphics.expert_badge.png");
CollectibleBadge = Service.IconManager.GetAssemblyTexture("Graphics.collectible_badge.png");
Expand All @@ -85,6 +85,12 @@ public RecipeNote() : base("Craftimizer RecipeNote", WindowFlags, false)
ShowCloseButton = false;
IsOpen = true;

SizeConstraints = new WindowSizeConstraints
{
MinimumSize = new(-1),
MaximumSize = new(10000, 10000)
};

Service.WindowSystem.AddWindow(this);
}

Expand Down Expand Up @@ -182,12 +188,7 @@ public override void PreDraw()
var node = (AtkResNode*)Addon->Unk458; // unit.GetNodeById(59);
var nodeParent = Addon->Unk258; // unit.GetNodeById(57);

Position = pos + new Vector2(size.X, (nodeParent->Y + node->Y) * scale);
SizeConstraints = new WindowSizeConstraints
{
MinimumSize = new(-1),
MaximumSize = new(10000, 10000)
};
Position = ImGuiHelpers.MainViewport.Pos + pos + new Vector2(size.X, (nodeParent->Y + node->Y) * scale);
}

public override void Draw()
Expand Down

0 comments on commit f8c5f9c

Please sign in to comment.