mirror of
https://github.com/ShareX/ShareX.git
synced 2024-10-02 18:26:27 +13:00
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:
parent
a2ab6296cb
commit
e5086a9609
1 changed files with 3 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue