Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
According to the official Apple documentation of UIView convertRect:fromWindow:
The view with rect in its coordinate system. If view is *nil*, this method instead converts from window base coordinates. Otherwise, both view and the receiver must belong to the same UIWindow object."
However, if I pass null for the fromView parameter in MonoTouch I get an immediate ArgumentNullException. This makes it impossible to covert from window base coordinates.
The same bug definitely exists in UIWindow.ConvertRectFromView and probably also in all other [UIWindow|UIView].Convert[Point|Rect][To|From][Window|View] methods.
In any of these methods the second parameter may be legally nil. Therefore MonoTouch should allow passing null for this parameter and not throw an ArgumentNullException.
Some of them already allows `null` while other throws an exception. I'll review/fix them.
Thanks for the report.
ConvertPoint* were already correct.
ConvertRect* were missing a [NullAllowed] attribute.
Fixed in master a7577f9f67726d514e8e330ac71dc601b210c40b
Fixed in 5.2-series 6bd36e6657f3ffc4dae3735d6a6339e6be185718
QA: unit tests added