Dim.Percent() generating incorrect Width
See original GitHub issueThe code below produces this result. The right hand TextField does not have a width of 40%
Application.Init();
var win = new Window("Test") { X = 0, Y = 0, Width = Dim.Fill(), Height = Dim.Fill() };
var textLeft = new TextField("Left") { X = 0, Y = 0, Width = Dim.Percent(40) };
var textRight = new TextField("Right") { X = Pos.Right(textLeft)+1, Width = Dim.Percent(40) };
win.Add(textLeft, textRight);
Application.Top.Add(win);
Application.Run ();
Issue Analytics
- State:
- Created 3 years ago
- Comments:18 (1 by maintainers)
Top Results From Across the Web
Dim.Percent() generating incorrect Width · Issue #623
Actually, I believe Dim.Percent is designed to provide a width that is relative to the area to the right (or below) the view....
Read more >Are the decimal places in a CSS width respected?
If it's a percentage width, then yes, it is respected: #outer { width: 200px; } #first { width: 50%; height: 20px; background-color: red;...
Read more ><percentage> - CSS: Cascading Style Sheets - MDN Web Docs
The CSS data type represents a percentage value. It is often used to define a size as relative to an element's parent object....
Read more >Setting Height And Width On Images Is Important Again
Yes, when an image is being shown at full size, without any CSS changing any dimensions, it is useful to resolve the layout...
Read more >Centering Percentage Width/Height Elements
If you know the exact width/height of an element, you can center it ... Instead of using negative margins, you use negative translate()...
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
Thank you for the explanation BDisp! I did notice it, and I could swear I put a comment somewhere, but not here.
Thank you!
I’ve sensed something wrong here too, but wasn’t sure. Thanks for getting a good repro!