Fix viewport offset on RecipeNote

This commit is contained in:
Asriel Camora
2023-11-08 04:24:10 -08:00
parent 9a490c1653
commit f8c5f9c9db
+8 -7
View File
@@ -71,7 +71,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
private IDalamudTextureWrap NoManipulationBadge { get; } private IDalamudTextureWrap NoManipulationBadge { get; }
private GameFontHandle AxisFont { 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"); ExpertBadge = Service.IconManager.GetAssemblyTexture("Graphics.expert_badge.png");
CollectibleBadge = Service.IconManager.GetAssemblyTexture("Graphics.collectible_badge.png"); CollectibleBadge = Service.IconManager.GetAssemblyTexture("Graphics.collectible_badge.png");
@@ -85,6 +85,12 @@ public sealed unsafe class RecipeNote : Window, IDisposable
ShowCloseButton = false; ShowCloseButton = false;
IsOpen = true; IsOpen = true;
SizeConstraints = new WindowSizeConstraints
{
MinimumSize = new(-1),
MaximumSize = new(10000, 10000)
};
Service.WindowSystem.AddWindow(this); Service.WindowSystem.AddWindow(this);
} }
@@ -182,12 +188,7 @@ public sealed unsafe class RecipeNote : Window, IDisposable
var node = (AtkResNode*)Addon->Unk458; // unit.GetNodeById(59); var node = (AtkResNode*)Addon->Unk458; // unit.GetNodeById(59);
var nodeParent = Addon->Unk258; // unit.GetNodeById(57); var nodeParent = Addon->Unk258; // unit.GetNodeById(57);
Position = pos + new Vector2(size.X, (nodeParent->Y + node->Y) * scale); Position = ImGuiHelpers.MainViewport.Pos + pos + new Vector2(size.X, (nodeParent->Y + node->Y) * scale);
SizeConstraints = new WindowSizeConstraints
{
MinimumSize = new(-1),
MaximumSize = new(10000, 10000)
};
} }
public override void Draw() public override void Draw()