Commit aaabd9f2 authored by Dylan Smith's avatar Dylan Smith Committed by Alexandre Julliard

wordpad: Fixed spacing calculations for print preview.

parent a03bc726
...@@ -690,7 +690,7 @@ LRESULT print_preview(HWND hMainWnd) ...@@ -690,7 +690,7 @@ LRESULT print_preview(HWND hMainWnd)
float ratioWidth, ratioHeight, ratio; float ratioWidth, ratioHeight, ratio;
int xOffset, yOffset; int xOffset, yOffset;
int barheight; int barheight;
float spacing = 20.0; float spacing = 10.0;
HWND hReBar = GetDlgItem(hMainWnd, IDC_REBAR); HWND hReBar = GetDlgItem(hMainWnd, IDC_REBAR);
PAINTSTRUCT ps; PAINTSTRUCT ps;
...@@ -752,12 +752,12 @@ LRESULT print_preview(HWND hMainWnd) ...@@ -752,12 +752,12 @@ LRESULT print_preview(HWND hMainWnd)
} }
barheight = SendMessageW(hReBar, RB_GETBARHEIGHT, 0, 0); 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) if(preview.hdc2)
ratioWidth = ((float)window.right / 2.0 - spacing * 2.0) / (float)bmWidth; ratioWidth = ((window.right - spacing * 3) / 2.0) / (float)bmWidth;
else else
ratioWidth = ((float)window.right - spacing * 3.0) / (float)bmWidth; ratioWidth = (window.right - spacing * 2) / (float)bmWidth;
if(ratioWidth > ratioHeight) if(ratioWidth > ratioHeight)
ratio = ratioHeight; ratio = ratioHeight;
...@@ -772,7 +772,7 @@ LRESULT print_preview(HWND hMainWnd) ...@@ -772,7 +772,7 @@ LRESULT print_preview(HWND hMainWnd)
if(!preview.hdc2) if(!preview.hdc2)
xOffset = (window.right - bmNewWidth) / 2; xOffset = (window.right - bmNewWidth) / 2;
else else
xOffset = (window.right - bmNewWidth * 2) / 2; xOffset = (window.right - bmNewWidth * 2) / 3;
window.top = barheight; window.top = barheight;
FillRect(hdc, &window, GetStockObject(GRAY_BRUSH)); FillRect(hdc, &window, GetStockObject(GRAY_BRUSH));
...@@ -790,8 +790,8 @@ LRESULT print_preview(HWND hMainWnd) ...@@ -790,8 +790,8 @@ LRESULT print_preview(HWND hMainWnd)
if(preview.hdc2) if(preview.hdc2)
{ {
background.left += bmNewWidth + spacing; background.left += bmNewWidth + xOffset;
background.right += bmNewWidth + spacing; background.right += bmNewWidth + xOffset;
FillRect(hdc, &background, GetStockObject(BLACK_BRUSH)); FillRect(hdc, &background, GetStockObject(BLACK_BRUSH));
...@@ -803,7 +803,7 @@ LRESULT print_preview(HWND hMainWnd) ...@@ -803,7 +803,7 @@ LRESULT print_preview(HWND hMainWnd)
if(preview.hdc2) 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); DeleteDC(fr.hdcTarget);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment