mirror of
https://github.com/greenshot/greenshot
synced 2025-08-20 13:33:27 -07:00
Fixed a case with Drag & Drop of images where the transparency is gone. Also fixed the editor "Center" patch, this was only working when width & height were smaller.
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2283 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
41a63f5847
commit
a075a81daf
3 changed files with 41 additions and 3 deletions
|
@ -1207,11 +1207,16 @@ namespace Greenshot {
|
|||
}
|
||||
Size imageSize = this.Surface.Image.Size;
|
||||
Size currentImageClientSize = this.panel1.ClientSize;
|
||||
if (currentImageClientSize.Height > imageSize.Height && currentImageClientSize.Width > imageSize.Width) {
|
||||
if (currentImageClientSize.Width > imageSize.Width) {
|
||||
var canvas = this.Surface as Control;
|
||||
if (canvas != null) {
|
||||
canvas.Left = (currentImageClientSize.Width - imageSize.Width) / 2;
|
||||
}
|
||||
}
|
||||
if (currentImageClientSize.Height > imageSize.Height) {
|
||||
var canvas = this.Surface as Control;
|
||||
if (canvas != null) {
|
||||
canvas.Top = (currentImageClientSize.Height - imageSize.Height) / 2;
|
||||
canvas.Left = (currentImageClientSize.Width - imageSize.Width) / 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue