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:
RKrom 2013-01-05 23:55:36 +00:00
commit 42011d2588
2 changed files with 21 additions and 3 deletions

View file

@ -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));