mirror of
https://github.com/emilk/egui.git
synced 2026-09-03 07:10:04 -04:00
[window] round position to nearest physical pixel, not nearest point
This commit is contained in:
@@ -131,7 +131,7 @@ impl Area {
|
|||||||
vel: Vec2::zero(),
|
vel: Vec2::zero(),
|
||||||
});
|
});
|
||||||
state.pos = fixed_pos.unwrap_or(state.pos);
|
state.pos = fixed_pos.unwrap_or(state.pos);
|
||||||
state.pos = state.pos.round();
|
state.pos = ctx.round_pos_to_pixels(state.pos);
|
||||||
|
|
||||||
Prepared {
|
Prepared {
|
||||||
layer,
|
layer,
|
||||||
@@ -213,8 +213,7 @@ impl Prepared {
|
|||||||
ctx.input().screen_size.x - margin,
|
ctx.input().screen_size.x - margin,
|
||||||
ctx.input().screen_size.y - margin,
|
ctx.input().screen_size.y - margin,
|
||||||
));
|
));
|
||||||
|
state.pos = ctx.round_pos_to_pixels(state.pos);
|
||||||
state.pos = state.pos.round();
|
|
||||||
|
|
||||||
// ctx.debug_rect(
|
// ctx.debug_rect(
|
||||||
// Rect::from_min_size(state.pos, state.size),
|
// Rect::from_min_size(state.pos, state.size),
|
||||||
|
|||||||
Reference in New Issue
Block a user