private void resizeToolStripMenuItem_Click(object sender, EventArgs args) { SizeForm form = new SizeForm(map.Width, map.Height); form.ShowDialogCenter(this); if (!form.OK) { return; } int n = form.N; int e = form.E; int s = form.S; int w = form.W; if (-n >= Height || -s >= Height || -e >= Width || -w >= Width || -(n + s) >= Height || -(e + w) >= Width) { ErrorBox("The parameters you provided make it impossible to resize the map.", "Invalid parameters!"); } map.Resize(n, e, s, w); }
private void resizeToolStripMenuItem_Click(object sender, EventArgs args) { SizeForm form = new SizeForm(map.Width, map.Height); form.ShowDialogCenter(this); if (!form.OK) return; int n = form.N; int e = form.E; int s = form.S; int w = form.W; if(-n >= Height || -s >= Height || -e >= Width || -w >= Width || -(n+s) >= Height || -(e+w) >= Width) { ErrorBox("The parameters you provided make it impossible to resize the map.", "Invalid parameters!"); } map.Resize(n, e, s, w); }