Uh oh!
There was an error while loading. Please reload this page.
Added DrawRectangle overload accepting RectangleF - #62385
Conversation
ghost
commented
Dec 4, 2021
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.
|
Wraith2
commented
Dec 4, 2021
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. |
medo64
commented
Dec 4, 2021
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 |
medo64
commented
Dec 6, 2021
Added, thank you. |
safern
commented
Dec 6, 2021
@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. |
medo64
commented
Dec 15, 2021
API proposal has been approved. Please reopen this pull request. |
safern
commented
Dec 15, 2021
@medo64 could you mind adding a test for each added API |
|
safern
commented
Dec 15, 2021
@teo-tsirpanis the other overloads are available for all target frameworks, so I think it is fine to keep them in all targets. |
teo-tsirpanis
commented
Dec 15, 2021
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:
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
medo64
commented
Jan 10, 2022
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 |
medo64
commented
Jan 11, 2022
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? |
medo64
commented
Jan 11, 2022
Do you mean |
safern
commented
Jan 11, 2022
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.
safern
commented
Jan 11, 2022
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.