(Desktop) minimumInteractiveComponentSize + size/width/height Modifier leads to inconsistent placement #4999
Labels
bug
Something isn't working
rendering
Low level rendering
upstream (AOSP)
Issue is in Google issue tracker
Describe the bug
When using both .minimumInteractiveComponentSize() and .size()/.width()/.height() on the same composable, it is placed correctly when the value used for .size() is an even number and one pixel off (to the right for width, down for height, both for size) when it is an odd number. I noticed this when using IconButton scaling with AppTheme.fixedLineHeight (in this case 19), since IconButton has .minimumInteractiveComponentSize() integrated, but it is not restricted to them.
Affected platforms
Versions
To Reproduce
Steps to reproduce the behavior:
Run this code snippet:
Expected behavior
20 green boxes appear above each other without space between them and aligned with the window's left border.
Observed behavior
20 green boxes appear, every second one is shifted one pixel to the right and below, leading to unintended spaces and overlap.
Screenshots
![Screenshot from 2024-06-20 03-47-48](https://private-user-images.githubusercontent.com/51082019/341241882-8aa46142-32fb-4754-827e-ec5fbb806caa.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjU1OTM4NjksIm5iZiI6MTcyNTU5MzU2OSwicGF0aCI6Ii81MTA4MjAxOS8zNDEyNDE4ODItOGFhNDYxNDItMzJmYi00NzU0LTgyN2UtZWM1ZmJiODA2Y2FhLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTA2VDAzMzI0OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTEyOGZmYWM5YjhlNTNjMjk2Mjc4ZDkxNjQ5NzFiZDJlNTYxOGI1YmFjZDMxODg5ZTVjMDg0ZTQ1MDBjMWJmNzQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.JgMDVHZ2TJZKv0qHLBt5sLrQkPbAldRQ0i3hz5B4zkE)
Additional context
The Column + repeat is just to make the problem and how it's tied to odd numbers more obvious (the first box is not visible as it's fully inside the second one); the problem will also appear when using just a single box.
The text was updated successfully, but these errors were encountered: