mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 18:57:28 -07:00
Fixed the bug reported here: https://sourceforge.net/projects/greenshot/forums/forum/676082/topic/6510105/index/page/1
The resizing didn't work, after the resizing was fixed the OCR didn't work and I had to change to resize the canvas... now it seems to be working again. git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2410 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
c352c4061b
commit
42011d2588
2 changed files with 21 additions and 3 deletions
|
@ -1321,7 +1321,17 @@ namespace GreenshotPlugin.Core {
|
|||
nPercentW = ((float)newWidth / (float)sourceImage.Width);
|
||||
nPercentH = ((float)newHeight / (float)sourceImage.Height);
|
||||
if (maintainAspectRatio) {
|
||||
if (nPercentH != 0 && nPercentH < nPercentW) {
|
||||
if (nPercentW == 1) {
|
||||
nPercentW = nPercentH;
|
||||
if (canvasUseNewSize) {
|
||||
destX = Math.Max(0, System.Convert.ToInt32((newWidth - (sourceImage.Width * nPercentW)) / 2));
|
||||
}
|
||||
} else if (nPercentH == 1) {
|
||||
nPercentH = nPercentW;
|
||||
if (canvasUseNewSize) {
|
||||
destY = Math.Max(0, System.Convert.ToInt32((newHeight - (sourceImage.Height * nPercentH)) / 2));
|
||||
}
|
||||
} else if (nPercentH != 0 && nPercentH < nPercentW) {
|
||||
nPercentW = nPercentH;
|
||||
if (canvasUseNewSize) {
|
||||
destX = Math.Max(0, System.Convert.ToInt32((newWidth - (sourceImage.Width * nPercentW)) / 2));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue