Skip to content

Commit

Permalink
Don't hide maximum zoom in numericZoom.Maximum, use ZOOM_MAX constant…
Browse files Browse the repository at this point in the history
… instead.
  • Loading branch information
bbbradsmith committed Oct 11, 2024
1 parent eb3a28e commit 34f0a48
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
12 changes: 6 additions & 6 deletions BinxelviewForm.Designer.cs

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

9 changes: 6 additions & 3 deletions BinxelviewForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public partial class BinxelviewForm : Form
const int PRESET_VERSION = 2;
const int PALETTE_BITS = 14; // maximum bits to fill 128 x 128 square
const int PALETTE_DIM = 128; // should match paletteBox size
const int ZOOM_MAX = 32;

enum PaletteMode
{
Expand Down Expand Up @@ -1618,8 +1619,8 @@ private void buttonZoom_Click(object sender, EventArgs e)
{
++zoom;
}
if (zoom < numericZoom.Minimum) zoom = (int)numericZoom.Minimum; // TODO replace with ZOOM_MIN ZOOM_MAX
if (zoom > numericZoom.Maximum) zoom = (int)numericZoom.Maximum;
if (zoom < 1) zoom = 1;
if (zoom > ZOOM_MAX) zoom = ZOOM_MAX;
redrawOptions();
redrawPixels();

Expand All @@ -1628,7 +1629,7 @@ private void buttonZoom_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button != MouseButtons.Right) return;
--zoom;
if (zoom < numericZoom.Minimum) zoom = (int)numericZoom.Minimum; // TODO replace with ZOOM_MIN ZOOM_MAX
if (zoom < 1) zoom = 1;
redrawOptions();
redrawPixels();
}
Expand Down Expand Up @@ -2291,6 +2292,8 @@ private void BinxelviewForm_Load(object sender, EventArgs e)
posfont_regular = new Font(numericPosByte.Font, FontStyle.Regular);
posfont_bold = new Font(numericPosByte.Font, FontStyle.Bold);
comboBoxPalette.SelectedIndex = (int)PaletteMode.PALETTE_RGB - 1;
numericZoom.Minimum = 1;
numericZoom.Maximum = ZOOM_MAX;

// set default options
defaultOption();
Expand Down

0 comments on commit 34f0a48

Please sign in to comment.