<p><font size=2 face="sans-serif">Since upgrading to Wine-20040914, we've
noticed that a bug has been introduced in gdi32.dll that causes certain
pen strokes to be drawn with thickness that is far too wide. The
problem is in wine's handling of the STROKEPATH and the STROKEANDFILLPATH
emf records when playing enhanced metafiles. Specifically, there
seems to be a problem with an interaction between wine's temporary setting
of a world transform and a pen selection that happens during processing
of the record. </font>
<p><font size=2 face="sans-serif">In cvs on the Wine HQ site, we notice
that a SelectObject() for the pen was inserted in function DC_UpdateXforms()
in <b>dlls/gdi/dc.c</b> in revision 1.2 as follows:</font>
<br>
<table width=100%>
<tr>
<td width=100%><font size=1><tt>===================================================================<br>
RCS file: /home/wine/wine/dlls/gdi/dc.c,v<br>
retrieving revision 1.1<br>
retrieving revision 1.2<br>
diff -u -p -r1.1 -r1.2<br>
--- wine/dlls/gdi/dc.c
2004/07/21 04:07:28
1.1<br>
+++ wine/dlls/gdi/dc.c
2004/09/13 18:03:44
1.2<br>
@@ -262,10 +262,13 @@ void DC_UpdateXforms( DC *dc )<br>
dc->vport2WorldValid = DC_InvertXform( &dc->xformWorld2Vport,<br>
&dc->xformVport2World );<br>
<br>
- /* Reselect the font back into the dc so that the font size<br>
+ /* Reselect the font and pen back into the dc so that the
size<br>
gets updated. */<br>
if(memcmp(&oldworld2vport, &dc->xformWorld2Vport,
sizeof(oldworld2vport)))<br>
+ {<br>
SelectObject(dc->hSelf, GetCurrentObject(dc->hSelf,
OBJ_FONT));<br>
+ SelectObject(dc->hSelf, GetCurrentObject(dc->hSelf,
OBJ_PEN));<br>
+ }<br>
}</tt></font><font size=3><tt><br>
</tt></font></table>
<br><font size=2 face="sans-serif">The pen is set after the call that modifies
the world transform to the identity and before it is reset back to its
normal values.</font>
<p><font size=2 face="sans-serif">If we remove the call to SelectObject
that selects the pen (shown in the code above), the bug disappears.</font>
<p><font size=2 face="sans-serif">Advice on the best way to proceed would
be greatly appreciated.</font>
<p><font size=2 face="sans-serif">1) Why was this change made? </font>
<p><font size=2 face="sans-serif">2) Is the best fix simply to undo
this change or is there a better solution (e.g. fix the strokepath
implementation)?</font>