-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added DrawRectangle overload accepting RectangleF #62385
Conversation
Tagging subscribers to this area: @dotnet/area-system-drawing Issue DetailsFillRectangle contains the following 4 overloads:
However, DrawRectangle, contains only the following 3 overloads:
In the interest of symmetry, I propose adding the "missing" RectangleF overload:
Since overload taking individual elements already exists, this new overload will just "decompose" rectangle structure into individual elements and call the existing function. Approach is exactly the one used in FillRectangle code.
|
If there is an approved api issue for this can you link to it please? If not you will need to go through the Api Approval Process before it is added. |
I have added the API proposal. Will wait for result of the same. :) |
Since you are adding a new API you also have to add it in the reference assembly's sources. runtime/src/libraries/System.Drawing.Common/ref/System.Drawing.Common.cs Lines 508 to 512 in fedf64f
|
Added, thank you. |
@medo64 thanks for your contribution, given that the API Proposal issue has to be approved first, let's wait for it get reviewed by the review board and if approved we can reopen this PR. I will close the PR to follow the API Proposal guidelines on the repository, and we can reopen when ready. |
API proposal has been approved. Please reopen this pull request. |
@medo64 could you mind adding a test for each added API |
|
@teo-tsirpanis the other overloads are available for all target frameworks, so I think it is fine to keep them in all targets. |
Well, I got confused, the .NET Framework 4.6.1 assembly on NuGet has only type forwards on the framework library, not actual types. |
For For I do have two extra questions in regards to tests though:
|
Anything else you fill needs to be added or this is it? |
I think @teo-tsirpanis was right and we need to move the APIs to the |
I see that there are some tests already in GraphicsTests.Core.cs and that one seems to be targeting NETCoreApp. Should I add tests in this one or you want me to create a new file instead? |
Do you mean |
Adding them to that file seems better.
Yeah, I missed the |
* Only testing RectangleF overloads in GraphicsTests.Core.cs; other overloads stay as they are. * FillPie tests that were newly added as part of issue #62385 are split in the same manner.
DrawRectangle with RectangleF overload is new and not compiled into mono.
Thank you @medo64! |
FillRectangle contains the following 4 overloads:
However, DrawRectangle, contains only the following 3 overloads:
In the interest of symmetry, I propose adding the "missing" RectangleF overload:
Since overload taking individual elements already exists, this new overload will just "decompose" rectangle structure into individual elements and call the existing function. Approach is exactly the one used in FillRectangle code.