Should Rect Width and Height have negative values?
See original GitHub issueThere is no logic in that because what defines that the Rect
could have negative values are your sides.
e.g.:
r = new Rect (-10, -10, 5, 5)
result in the follow:
Left = -10, Right = -5, Top = -10, Botton = -5
Thoughts, please???
Issue Analytics
- State:
- Created 3 years ago
- Comments:15
Top Results From Across the Web
Why System.Drawing.Rectangle allow contain negative ...
No, it means that you ran out of space, and the width should be treated as zero. Also, the width may go negative...
Read more >rect.Contains cant accept rects with a negative width and ...
A Rectangle whose width or height is negative has neither location nor dimension along those axes with negative dimensions. Such a Rectangle is ......
Read more >Can the width of a rectangular solid be negative?
No, width basically means length. Length can never be negative. It may be considered negative from a frame of reference. For e.g. the...
Read more >Rectangle does funny things with negative height/width ...
If you have a rectangle with a negative height or width values, it will be created in ways that may be confusing to...
Read more >Rect.Width Property (System.Windows)
Property Value A positive number that represents the width of the rectangle. The default is 0.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We should not allow negatives for now - this will catch bugs if they crop up.
If one day there is a scenario that makes sense we can explicitly enable this back, for now the checks seem like they do more good. I merged the patch that had this.
If you do this, please bring over the the updated implementations of all three classes, or figure out how to reference System.Windows directly. We should NOT have duplicated/modified code for such fundamental classes that have been so thoroughly tested.