Small fontdlg fix, take 2

Rein Klazes rklazes at xs4all.nl
Tue Nov 25 11:34:22 CST 2003


Hi,

Resubmit, following the comment from Shachar.

Changelog:
	dlls/commdlg	: fontdlg.c
	Fix "sample" box drawing by adding some needed coordinate
	and size transformations.

Rein.
-- 
Rein Klazes
rklazes at xs4all.nl
-------------- next part --------------
--- wine/dlls/commdlg/fontdlg.c	2003-09-10 05:56:48.000000000 +0200
+++ mywine/dlls/commdlg/fontdlg.c	2003-11-25 16:55:24.000000000 +0100
@@ -916,6 +916,7 @@
 
                     if( GetWindowInfo( GetDlgItem( hDlg, stc5), &wininfo ) )
 		    {
+                        MapWindowPoints( 0, hDlg, (LPPOINT) &wininfo.rcWindow, 2);
                         InvalidateRect( hDlg, &wininfo.rcWindow, TRUE );
 		    }
                   }
@@ -932,6 +933,7 @@
 
                     if( GetWindowInfo( GetDlgItem( hDlg, stc5), &wininfo ) )
 		    {
+                        MapWindowPoints( 0, hDlg, (LPPOINT) &wininfo.rcWindow, 2);
                         InvalidateRect( hDlg, &wininfo.rcWindow, TRUE );
 		    }
 		  }
@@ -982,9 +984,11 @@
         HPEN hOrigPen;
         HFONT hOrigFont;
         COLORREF rgbPrev;
-        WCHAR sample[SAMPLE_EXTLEN+5]={'A','a','B','b'};
+        WCHAR sample[SAMPLE_EXTLEN+9]={'A','a','B','b','Y','y','Z','z'};
+        LOGFONTA lf = *(lpcf->lpLogFont);
         /* Always start with this basic sample */
 
+        MapWindowPoints( 0, hDlg, (LPPOINT) &info.rcWindow, 2);
         hdc=BeginPaint( hDlg, &ps );
 
         /* Paint frame */
@@ -1006,7 +1010,8 @@
         info.rcWindow.bottom--;
         info.rcWindow.top++;
         info.rcWindow.left++;
-        hOrigFont=SelectObject( hdc, CreateFontIndirectA( lpcf->lpLogFont ) );
+        lf.lfHeight = MulDiv(lf.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
+        hOrigFont = SelectObject( hdc, CreateFontIndirectA( &lf ) );
         rgbPrev=SetTextColor( hdc, lpcf->rgbColors );
 
         DrawTextW( hdc, sample, -1, &info.rcWindow, DT_CENTER|DT_VCENTER|DT_SINGLELINE );


More information about the wine-patches mailing list