Ticket #14904 (closed defect: fixed)

Opened 6 months ago

Last modified 6 months ago

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: Patch: no
Blocking:

Description

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

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

Change History

Changed 6 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 6 months ago by erdem_ua

Changed 6 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.
Regards.

Changed 6 months ago by csomor

  • owner set to csomor
  • status changed from new to accepted

thanks,

Changed 6 months ago by SC

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

Changed 6 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.
O:)

Changed 6 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

Changed 6 months ago by csomor

to be exact: by the wxWindow's border

Changed 6 months ago by erdem_ua

  • status changed from accepted to closed
  • resolution set to fixed

Thanks :)

Note: See TracTickets for help on using tickets.