Scale Greenshot editor window size when icons larger than default

Scales based on approximate number of icons displayed and size of icon
over 16 pixels
This commit is contained in:
campbeb 2016-07-09 16:37:02 -04:00
parent a2ab6296cb
commit e5086a9609

View file

@ -327,8 +327,9 @@ private void SurfaceSizeChanged(object sender, EventArgs e)
Size imageSize = Surface.Image.Size;
Size currentFormSize = Size;
Size currentImageClientSize = panel1.ClientSize;
int minimumFormWidth = 650;
int minimumFormHeight = 530;
// Scale minimum size based on icons over default 16 pixels
int minimumFormWidth = 650 + 24 * Math.Max(coreConfiguration.IconSize.Width - 16, 0);
int minimumFormHeight = 530 + 17 * Math.Max(coreConfiguration.IconSize.Height - 16, 0);
int newWidth = Math.Max(minimumFormWidth, currentFormSize.Width - currentImageClientSize.Width + imageSize.Width);
int newHeight = Math.Max(minimumFormHeight, currentFormSize.Height - currentImageClientSize.Height + imageSize.Height);
Size = new Size(newWidth, newHeight);