Skip to content

Commit

Permalink
Bug fix to [esc] key behaviour
Browse files Browse the repository at this point in the history
- Using [esc] to 'unload' spritesheet works again.
- Added description of [esc] key functionality to new help-text label.
  • Loading branch information
ForkandBeard committed May 10, 2017
1 parent 46b6ee8 commit 9020832
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 10 deletions.
16 changes: 7 additions & 9 deletions ASU/UI/MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 20 additions & 1 deletion ASU/UI/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -796,7 +796,14 @@ private void MainPanel_Paint(object sender, System.Windows.Forms.PaintEventArgs

graphics = Graphics.FromImage(PaintedImage);
graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
graphics.Clear(this.unpackers[0].CreateOuterBackgroundColour());
if (this.unpackers.Count >= 1)
{
graphics.Clear(this.unpackers[0].CreateOuterBackgroundColour());
}
else
{
graphics.Clear(Color.Black);
}
graphics.DrawImage(SheetWithBoxes, this.Offset);

Rectangle boxOffset;
Expand Down Expand Up @@ -1547,6 +1554,18 @@ protected override bool ProcessCmdKey(ref System.Windows.Forms.Message msg, Syst

if (keyData == Keys.Escape)
{
if (this.OriginalImage != null)
{
this.OriginalImage.Dispose();
this.OriginalImage = null;
}

if (this.PaintedImage != null)
{
this.PaintedImage.Dispose();
this.PaintedImage = null;
}

if (this.unpackers.Count == 1 && this.AreAllUnpacked())
{
this.unpackers.Clear();
Expand Down
7 changes: 7 additions & 0 deletions ASU/UI/MainForm.resx
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@
<metadata name="ImageClipperAndAnimatorTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<data name="ControlsHelpLabel.Text" xml:space="preserve">
<value>[left click] select or split frame
[right click] toggle select / split mode
[ctrl + left drag] select multiple frames
[cursor keys] move pointer by single pixel
[esc] unload current sprite sheet</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
Expand Down

0 comments on commit 9020832

Please sign in to comment.