mirror of
https://github.com/danbulant/mangui
synced 2026-06-20 23:01:11 +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();
|
||||
surface.resize(&buffer_context, width, height);
|
||||
let mut groot = groot.write().unwrap();
|
||||
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.height = Dimension::Points(size.height as f32 * scale_factor as f32);
|
||||
// let scale_factor = window.scale_factor();
|
||||
groot.style.layout.size.width = Dimension::Points(size.width as f32);
|
||||
groot.style.layout.size.height = Dimension::Points(size.height as f32);
|
||||
drop(groot);
|
||||
window.request_redraw();
|
||||
},
|
||||
|
|
@ -131,7 +131,7 @@ fn main() {
|
|||
}
|
||||
}
|
||||
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);
|
||||
},
|
||||
_ => {}
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ pub fn render_recursively(node: &SharedGNode, context: &mut RenderContext<OpenGl
|
|||
let sself = node.clone();
|
||||
context.canvas.save();
|
||||
context.canvas.translate(layout.location.x, layout.location.y);
|
||||
dbg!(node, layout);
|
||||
// dbg!(node, layout);
|
||||
match styles.overflow {
|
||||
Overflow::Visible => {},
|
||||
Overflow::Hidden => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue