mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 22:53:14 -04:00
Store Margin using i8 to reduce its size (#5567)
Adds `Marginf` to fill the previous niche. This is all in a pursuit to shrink the sizes of often-used structs, to improve performance (less cache misses, less memcpy:s, etc). * On the path towards https://github.com/emilk/egui/issues/4019
This commit is contained in:
@@ -92,10 +92,10 @@ impl Keypad {
|
||||
ui.vertical(|ui| {
|
||||
let window_margin = ui.spacing().window_margin;
|
||||
let size_1x1 = vec2(32.0, 26.0);
|
||||
let _size_1x2 = vec2(32.0, 52.0 + window_margin.top);
|
||||
let _size_2x1 = vec2(64.0 + window_margin.left, 26.0);
|
||||
let _size_1x2 = vec2(32.0, 52.0 + window_margin.topf());
|
||||
let _size_2x1 = vec2(64.0 + window_margin.leftf(), 26.0);
|
||||
|
||||
ui.spacing_mut().item_spacing = Vec2::splat(window_margin.left);
|
||||
ui.spacing_mut().item_spacing = Vec2::splat(window_margin.leftf());
|
||||
|
||||
ui.horizontal(|ui| {
|
||||
if ui.add_sized(size_1x1, Button::new("1")).clicked() {
|
||||
|
||||
Reference in New Issue
Block a user