Skip to content

Commit

Permalink
Merge pull request #83 from cwensley/fix-rip-font-picker
Browse files Browse the repository at this point in the history
Fix rip font picker
  • Loading branch information
cwensley authored Feb 26, 2023
2 parents 2a1a67f + d303554 commit 9da7484
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions Source/Pablo/Formats/Rip/Controls/FontStylePad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,21 @@ Control FontType()
Size = new Size(40, 40)
};

drawable.MouseUp += delegate
{
SelectFont();
};

drawable.Paint += delegate(object sender, PaintEventArgs pe)
{
if (canvas != null)
canvas.DrawRegion(pe.Graphics, new Rectangle(Point.Empty, canvas.WindowSize));
};
drawable.MouseUp += (sender, e) => SelectFont();

drawable.LoadComplete += delegate // Shown?
drawable.Paint += (sender, e) =>
{
if (drawable.Size.IsEmpty)
return;
canvas = new BGICanvas(drawable, drawable.Size);
DrawCanvas();
if (canvas == null || canvas.WindowSize != drawable.Size)
{
canvas = new BGICanvas(drawable, drawable.Size);
DrawCanvas();
}

canvas?.DrawRegion(e.Graphics, new Rectangle(Point.Empty, canvas.WindowSize));
};

return drawable;
}

Expand Down

0 comments on commit 9da7484

Please sign in to comment.