mirror of
https://github.com/danbulant/mangui
synced 2026-07-07 11:50:36 +00:00
fix scale
This commit is contained in:
parent
aa6af36836
commit
f85cc62f1f
2 changed files with 5 additions and 5 deletions
|
|
@ -110,9 +110,9 @@ fn main() {
|
||||||
let height: NonZeroU32 = NonZeroU32::new(size.height).unwrap();
|
let height: NonZeroU32 = NonZeroU32::new(size.height).unwrap();
|
||||||
surface.resize(&buffer_context, width, height);
|
surface.resize(&buffer_context, width, height);
|
||||||
let mut groot = groot.write().unwrap();
|
let mut groot = groot.write().unwrap();
|
||||||
let scale_factor = window.scale_factor();
|
// let scale_factor = window.scale_factor();
|
||||||
groot.style.layout.size.width = Dimension::Points(size.width as f32 * scale_factor as f32);
|
groot.style.layout.size.width = Dimension::Points(size.width as f32);
|
||||||
groot.style.layout.size.height = Dimension::Points(size.height as f32 * scale_factor as f32);
|
groot.style.layout.size.height = Dimension::Points(size.height as f32);
|
||||||
drop(groot);
|
drop(groot);
|
||||||
window.request_redraw();
|
window.request_redraw();
|
||||||
},
|
},
|
||||||
|
|
@ -131,7 +131,7 @@ fn main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
context.taffy.compute_layout(*context.taffy_map.get(&root).unwrap(), Size::MAX_CONTENT).unwrap();
|
context.taffy.compute_layout(*context.taffy_map.get(&root).unwrap(), Size::MAX_CONTENT).unwrap();
|
||||||
// dbg!(&root);
|
dbg!(&root);
|
||||||
render(&buffer_context, &surface, &window, &mut context, &root);
|
render(&buffer_context, &surface, &window, &mut context, &root);
|
||||||
},
|
},
|
||||||
_ => {}
|
_ => {}
|
||||||
|
|
|
||||||
|
|
@ -86,7 +86,7 @@ pub fn render_recursively(node: &SharedGNode, context: &mut RenderContext<OpenGl
|
||||||
let sself = node.clone();
|
let sself = node.clone();
|
||||||
context.canvas.save();
|
context.canvas.save();
|
||||||
context.canvas.translate(layout.location.x, layout.location.y);
|
context.canvas.translate(layout.location.x, layout.location.y);
|
||||||
dbg!(node, layout);
|
// dbg!(node, layout);
|
||||||
match styles.overflow {
|
match styles.overflow {
|
||||||
Overflow::Visible => {},
|
Overflow::Visible => {},
|
||||||
Overflow::Hidden => {
|
Overflow::Hidden => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue