http://bugs.winehq.org/show_bug.cgi?id=27584
Summary: MFC fillrect draws differently under wine Product: Wine Version: 1.3.21 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdi32 AssignedTo: wine-bugs@winehq.org ReportedBy: bailey937@yahoo.com
Created an attachment (id=35259) --> (http://bugs.winehq.org/attachment.cgi?id=35259) sample program for reproducing FillRect bug
I have a program that uses CPaintDC.FillRect() to draw histogram samples.
It draws one-pixel wide vertical rectangles.
Under wine, the bottom-most pixel is not drawn.
I'm attaching a sample program. Under Windows7 (have 64bit pro), the red line is touching the black baseline and the black line on the right is touching the baseline also.
When I run the program under wine, both the red vertical line on the left and the black vertical line on the right are floating one pixel above the baseline.
I tried both 32bit Ubuntu 11.04 (wine 1.2.2) on a netbook and also Fedora 15 64bit (wine 1.3.21) under Virtualbox on my Windows machine. Both have the same problem.
The relevant code for the test case is in
CChildView::OnPaint() in ChildView.cpp
http://bugs.winehq.org/show_bug.cgi?id=27584
--- Comment #1 from bailey937@yahoo.com 2011-06-24 06:46:17 CDT --- The sample program was made in VC2005 standard
http://bugs.winehq.org/show_bug.cgi?id=27584
--- Comment #2 from Dan Kegel dank@kegel.com 2011-06-24 10:41:50 CDT --- Created an attachment (id=35261) --> (http://bugs.winehq.org/attachment.cgi?id=35261) testcase translated into plain C
We generally like C examples without MFC, so I converted your example, see attachment.
http://bugs.winehq.org/show_bug.cgi?id=27584
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, testcase
http://bugs.winehq.org/show_bug.cgi?id=27584
--- Comment #3 from bailey937@yahoo.com 2011-06-25 06:38:22 CDT --- Thank you for translating it.
With the MS compiler, you need to move the declaration "int i = 0;" in onPaintBroken() up (it doesn't like variables being declared in the middle of a function in a .c file).
I built your translated example, and it reproduces the bug just like my original sample.
Thanks again.
https://bugs.winehq.org/show_bug.cgi?id=27584
--- Comment #4 from Bruno Jesus 00cpxxx@gmail.com --- Created attachment 47424 --> https://bugs.winehq.org/attachment.cgi?id=47424 compiled testcase
https://bugs.winehq.org/show_bug.cgi?id=27584
--- Comment #5 from Bruno Jesus 00cpxxx@gmail.com --- Created attachment 47425 --> https://bugs.winehq.org/attachment.cgi?id=47425 XP screenshot
https://bugs.winehq.org/show_bug.cgi?id=27584
Bruno Jesus 00cpxxx@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1
--- Comment #6 from Bruno Jesus 00cpxxx@gmail.com --- Still in wine 1.7.11.
https://bugs.winehq.org/show_bug.cgi?id=27584
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|MFC fillrect draws |FillRect() draws |differently under wine |differently under wine
--- Comment #7 from Nikolay Sivov bunglehead@gmail.com --- This happens with 1.8-rc2 as well.
https://bugs.winehq.org/show_bug.cgi?id=27584
Thomas Faller tfaller1@gmx.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |tfaller1@gmx.de
--- Comment #8 from Thomas Faller tfaller1@gmx.de --- There is no pixel missing. The position of the baseline is wrong because bottom and top are swapped:
From the exampel source:
... void onPaintBroken(HDC hdc) ... r.bottom = 115+110; r.top = 115+110 + 1; ...
Windows does not care about this, wine does. All is correct if I swap bottom and top.
https://bugs.winehq.org/show_bug.cgi?id=27584
--- Comment #9 from Dmitry Timoshkov dmitry@baikal.ru --- Attached compiled test case matches the attached XP screenshot under wine-1.9.10 for me, please retest.
https://bugs.winehq.org/show_bug.cgi?id=27584
--- Comment #10 from Nikolay Sivov bunglehead@gmail.com --- It's not fixed in 1.9.16.
https://bugs.winehq.org/show_bug.cgi?id=27584
joaopa jeremielapuree@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree@yahoo.fr
--- Comment #11 from joaopa jeremielapuree@yahoo.fr --- Created attachment 67420 --> https://bugs.winehq.org/attachment.cgi?id=67420 screenshot showing the bug in Wine
Bug still occurs with wine-5.10.
https://bugs.winehq.org/show_bug.cgi?id=27584
Damjan Jovanovic damjan.jov@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |damjan.jov@gmail.com
--- Comment #12 from Damjan Jovanovic damjan.jov@gmail.com --- There is a real bug here. FillRect() calls PatBlt(), passing it a negative width/height in the case of this app, and PatBlt() draws rectangles with negative width/height shifted 1 pixel too far right/down:
Windows (0,0) +------+ |+-----++ || || || || ++-----+| +------+ Wine
Patch with test sent: https://source.winehq.org/patches/data/195952
The testcase draws correctly with this patch.