Fixed the very old incorrect size information bug

git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@2333 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
RKrom 2012-11-29 14:02:23 +00:00
commit 2aa53d444b

View file

@ -591,9 +591,16 @@ namespace Greenshot.Forms {
// rulers
int dist = 8;
string captureWidth = (captureRect.Width + 1).ToString();
string captureHeight = (captureRect.Height + 1).ToString();
string captureWidth;
string captureHeight;
// The following fixes the very old incorrect size information bug
if (captureMode == CaptureMode.Window) {
captureWidth = captureRect.Width.ToString();
captureHeight = captureRect.Height.ToString();
} else {
captureWidth = (captureRect.Width + 1).ToString();
captureHeight = (captureRect.Height + 1).ToString();
}
using (Font rulerFont = new Font(FontFamily.GenericSansSerif, 8)) {
Size measureWidth = TextRenderer.MeasureText(captureWidth, rulerFont);
Size measureHeight = TextRenderer.MeasureText(captureHeight, rulerFont);