Skip to content

Commit 9020832

Browse files
committed
Bug fix to [esc] key behaviour
- Using [esc] to 'unload' spritesheet works again. - Added description of [esc] key functionality to new help-text label.
1 parent 46b6ee8 commit 9020832

3 files changed

Lines changed: 34 additions & 10 deletions

File tree

ASU/UI/MainForm.Designer.cs

Lines changed: 7 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ASU/UI/MainForm.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,14 @@ private void MainPanel_Paint(object sender, System.Windows.Forms.PaintEventArgs
796796

797797
graphics = Graphics.FromImage(PaintedImage);
798798
graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.NearestNeighbor;
799-
graphics.Clear(this.unpackers[0].CreateOuterBackgroundColour());
799+
if (this.unpackers.Count >= 1)
800+
{
801+
graphics.Clear(this.unpackers[0].CreateOuterBackgroundColour());
802+
}
803+
else
804+
{
805+
graphics.Clear(Color.Black);
806+
}
800807
graphics.DrawImage(SheetWithBoxes, this.Offset);
801808

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

15481555
if (keyData == Keys.Escape)
15491556
{
1557+
if (this.OriginalImage != null)
1558+
{
1559+
this.OriginalImage.Dispose();
1560+
this.OriginalImage = null;
1561+
}
1562+
1563+
if (this.PaintedImage != null)
1564+
{
1565+
this.PaintedImage.Dispose();
1566+
this.PaintedImage = null;
1567+
}
1568+
15501569
if (this.unpackers.Count == 1 && this.AreAllUnpacked())
15511570
{
15521571
this.unpackers.Clear();

ASU/UI/MainForm.resx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@
126126
<metadata name="ImageClipperAndAnimatorTimer.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
127127
<value>17, 17</value>
128128
</metadata>
129+
<data name="ControlsHelpLabel.Text" xml:space="preserve">
130+
<value>[left click] select or split frame
131+
[right click] toggle select / split mode
132+
[ctrl + left drag] select multiple frames
133+
[cursor keys] move pointer by single pixel
134+
[esc] unload current sprite sheet</value>
135+
</data>
129136
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
130137
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
131138
<value>

0 commit comments

Comments
 (0)