[ wxwindows-Patches-1877682 ] Inconsistent wxDC:SetClippingRegion()
SourceForge.net
noreply at sourceforge.net
Sun Feb 3 06:05:47 PST 2008
Patches item #1877682, was opened at 2008-01-22 23:00
Message generated for change (Comment added) made by vadz
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1877682&group_id=9863
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Other
Group: bug fix
>Status: Pending
Resolution: None
Priority: 5
Private: No
Submitted By: AmiArt (amiart)
>Assigned to: Nobody/Anonymous (nobody)
Summary: Inconsistent wxDC:SetClippingRegion()
Initial Comment:
The current implementation of SetClippingRegion(const wxRect& cliRect) converts the clipRect parameter from logical to device units but the overloaded version SetClippingRegion(const wxRegion& cliRegion) uses clipRegion directly without log->dev conversion.
So this code will set different clip region:
dc->SetDeviceOrigin(10, 10);
// (1)
wxRect clipRect(0,0,100,100);
dc->SetClippingRegion(clipRect);
// (2)
wxRegion clipRegion(clipRect);
dc->SetClippingRegion(clipRegion);
The attached patch changes SetClippingRegion(const wxRegion&) function so it performs correct conversion in wxGTK and wxMSW ports. The same changes must be done for wxMAC, wxX11 etc.
----------------------------------------------------------------------
>Comment By: Vadim Zeitlin (vadz)
Date: 2008-02-03 15:05
Message:
Logged In: YES
user_id=71618
Originator: NO
I'm not sure if the bug is in wxRegion or wxRect version to be honest.
Maybe we should interpret wxRect in device coordinates instead of
interpreting wxRegion in the logical ones, wouldn't this be more useful?
Robert, as our main region expert, do you have an opinion about this?
But if we do decide that the approach of your patch is correct, it should
definitely be done at wxDC::SetClippingRegion() level (in wx/dc.h) so that
it is done for all ports at once. Unless any of them already do this
translation but I don't think this is the case.
And in any case I don't think we should be changing this in 2.8 branch as
there can be code relying on the existing behaviour (and maybe correcting
for it by doing the conversion itself).
P.S. Assigning reports to me doesn't ensure that I look at them sooner,
rather it can prevent others from looking at them before I can.
----------------------------------------------------------------------
Comment By: AmiArt (amiart)
Date: 2008-01-22 23:02
Message:
Logged In: YES
user_id=1691168
Originator: YES
File Added: dcclient.cpp.patch
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=309863&aid=1877682&group_id=9863
More information about the wx-dev
mailing list