Dylan Smith : wordpad: Fixed spacing calculations for print preview.

Alexandre Julliard julliard at winehq.org
Fri Jan 29 10:56:35 CST 2010


Module: wine
Branch: master
Commit: aaabd9f2f3994b052ca9ece4cec08d715f7e38c1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=aaabd9f2f3994b052ca9ece4cec08d715f7e38c1

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Fri Jan 29 03:02:37 2010 -0500

wordpad: Fixed spacing calculations for print preview.

---

 programs/wordpad/print.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/programs/wordpad/print.c b/programs/wordpad/print.c
index a6bdf40..18a6de1 100644
--- a/programs/wordpad/print.c
+++ b/programs/wordpad/print.c
@@ -690,7 +690,7 @@ LRESULT print_preview(HWND hMainWnd)
     float ratioWidth, ratioHeight, ratio;
     int xOffset, yOffset;
     int barheight;
-    float spacing = 20.0;
+    float spacing = 10.0;
     HWND hReBar = GetDlgItem(hMainWnd, IDC_REBAR);
     PAINTSTRUCT ps;
 
@@ -752,12 +752,12 @@ LRESULT print_preview(HWND hMainWnd)
     }
 
     barheight = SendMessageW(hReBar, RB_GETBARHEIGHT, 0, 0);
-    ratioHeight = ((float)window.bottom - spacing - (float)barheight) / (float)bmHeight;
+    ratioHeight = (window.bottom - spacing * 2 - barheight) / (float)bmHeight;
 
     if(preview.hdc2)
-        ratioWidth = ((float)window.right / 2.0 - spacing * 2.0) / (float)bmWidth;
+        ratioWidth = ((window.right - spacing * 3) / 2.0) / (float)bmWidth;
     else
-        ratioWidth = ((float)window.right - spacing * 3.0) / (float)bmWidth;
+        ratioWidth = (window.right - spacing * 2) / (float)bmWidth;
 
     if(ratioWidth > ratioHeight)
         ratio = ratioHeight;
@@ -772,7 +772,7 @@ LRESULT print_preview(HWND hMainWnd)
     if(!preview.hdc2)
         xOffset = (window.right - bmNewWidth) / 2;
     else
-        xOffset = (window.right - bmNewWidth * 2) / 2;
+        xOffset = (window.right - bmNewWidth * 2) / 3;
 
     window.top = barheight;
     FillRect(hdc, &window, GetStockObject(GRAY_BRUSH));
@@ -790,8 +790,8 @@ LRESULT print_preview(HWND hMainWnd)
 
         if(preview.hdc2)
         {
-            background.left += bmNewWidth + spacing;
-            background.right += bmNewWidth + spacing;
+            background.left += bmNewWidth + xOffset;
+            background.right += bmNewWidth + xOffset;
 
             FillRect(hdc, &background, GetStockObject(BLACK_BRUSH));
 
@@ -803,7 +803,7 @@ LRESULT print_preview(HWND hMainWnd)
 
     if(preview.hdc2)
     {
-        BitBlt(hdc, xOffset + bmNewWidth + spacing, yOffset, bmNewWidth, bmNewHeight, preview.hdcSized2, 0, 0, SRCCOPY);
+        BitBlt(hdc, xOffset * 2 + bmNewWidth, yOffset, bmNewWidth, bmNewHeight, preview.hdcSized2, 0, 0, SRCCOPY);
     }
 
     DeleteDC(fr.hdcTarget);




More information about the wine-cvs mailing list