#14904 closed defect (fixed)

OSX wxClientDC coordinates slides by +2 pixels

Reported by: erdem_ua Owned by: csomor
Priority: high Milestone:
Component: wxOSX-Cocoa Version: 2.9.4
Keywords: Cc:
Blocked By: Blocking:
Patch: no


On OSX Cacao and wxWidgets version 2.9.4 (but AFAIK this is true for all previous 2.9 releases) wxClientDC coordinates are slides +2 pixel at both x and y vector.

Than 0,0 became +2,+2 at screen and leave first 2 pixels are not updated by last render and produce corruption/artifacts on screen...

Instead using wxWindowDC has no such an issue.

I believe this bug also effects wxCaret, so it miss aligned to text. Probably it's due use of wxClientDC at it's code.

Attachments (1)

minimal_wxClientDC_bug.cpp download (2.9 KB) - added by erdem_ua 23 months ago.

Download all attachments as: .zip

Change History (9)

comment:1 Changed 23 months ago by csomor

  • Status changed from new to infoneeded_new

the different between the windowdc and wxclient is the origin which for the first is at the border while for the second it is at the content. caret is using a completely different overlay dc. do you have a patch to minimal sample which shows a real drawing issues outside of wxCaret ?

Changed 23 months ago by erdem_ua

comment:2 Changed 23 months ago by erdem_ua

  • Status changed from infoneeded_new to new

Sorry not the patch but custom minimal program to show issue.
Valuable lines are located at 28 - 47.

wxPaintDC & wxWindowDC makes their job as intended.
But on OSX wx2.9.x CACAO has +2 pixel on both axis if you are do same thing with wxClientDC.

And same issue is available caret sample clearly.

comment:3 Changed 23 months ago by csomor

  • Owner set to csomor
  • Status changed from new to accepted


comment:4 Changed 23 months ago by SC

(In [73199]) setting offsets for window and client dcs when not in a paint event, see #14904

comment:5 Changed 22 months ago by erdem_ua

Looks fixed wxClientDC.
But this time I think the patch broke wxWindowDC.
wxWindowDC draw -2 pixel on both axis with the patch.

comment:6 Changed 22 months ago by csomor

wxWindowDC must draw on the border, that is correct, so the topleft will not be visible in your sample, as it is covered by the window's frame

comment:7 Changed 22 months ago by csomor

to be exact: by the wxWindow's border

comment:8 Changed 22 months ago by erdem_ua

  • Resolution set to fixed
  • Status changed from accepted to closed

Thanks :)

Note: See TracTickets for help on using tickets.