gpui: Disable rounding in the layout engine (#31836)
Rounding broke (among other things, probably) pixel-perfect image rendering with non-power-of-two scaling factor. An example which reproduces the problem can be found [here](https://github.com/WaffleLapkin/gpui_taffy_rounding_whyyyyy). How it looks with `gpui` from `main`:  How it looks with this patch:  Both screenshots are made on kde+wayland with magnification using kde's built-in magnification (`Meta`+`+`, `Meta`+`-`). Note that screenshot apps have a high chance of lying 🙃 The image itself is 400 by 300 pixels of red/green checkerboard pattern made specifically to exaggerate scaling issues. Release Notes: - N/A
This commit is contained in:
parent
0c78a115de
commit
f738fbd4f8
2 changed files with 4 additions and 2 deletions
|
@ -15440,7 +15440,7 @@ async fn test_completions_default_resolve_data_handling(cx: &mut TestAppContext)
|
|||
// Completions that have already been resolved are skipped.
|
||||
assert_eq!(
|
||||
*resolved_items.lock(),
|
||||
items[items.len() - 16..items.len() - 4]
|
||||
items[items.len() - 17..items.len() - 4]
|
||||
.iter()
|
||||
.cloned()
|
||||
.map(|mut item| {
|
||||
|
|
|
@ -28,8 +28,10 @@ const EXPECT_MESSAGE: &str = "we should avoid taffy layout errors by constructio
|
|||
|
||||
impl TaffyLayoutEngine {
|
||||
pub fn new() -> Self {
|
||||
let mut taffy = TaffyTree::new();
|
||||
taffy.disable_rounding();
|
||||
TaffyLayoutEngine {
|
||||
taffy: TaffyTree::new(),
|
||||
taffy,
|
||||
absolute_layout_bounds: FxHashMap::default(),
|
||||
computed_layouts: FxHashSet::default(),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue