Fix: allow calling set_pixels_per_point before first frame
Closes https://github.com/emilk/egui/issues/1153
This commit is contained in:
parent
55067f54ce
commit
5459ab29b7
2 changed files with 4 additions and 3 deletions
|
@ -46,6 +46,7 @@ NOTE: [`epaint`](epaint/CHANGELOG.md), [`eframe`](eframe/CHANGELOG.md), [`egui_w
|
|||
* Context menus now respects the theme ([#1043](https://github.com/emilk/egui/pull/1043))
|
||||
* Plot `Orientation` was not public, although fields using this type were ([#1130](https://github.com/emilk/egui/pull/1130))
|
||||
* Fixed `enable_drag` for Windows ([#1108](https://github.com/emilk/egui/pull/1108)).
|
||||
* Calling `Context::set_pixels_per_point` before the first frame will now work.
|
||||
|
||||
### Contributors 🙏
|
||||
* [AlexxxRu](https://github.com/alexxxru): [#1108](https://github.com/emilk/egui/pull/1108).
|
||||
|
|
|
@ -54,12 +54,12 @@ impl ContextImpl {
|
|||
fn begin_frame_mut(&mut self, new_raw_input: RawInput) {
|
||||
self.memory.begin_frame(&self.input, &new_raw_input);
|
||||
|
||||
let mut input = std::mem::take(&mut self.input);
|
||||
self.input = std::mem::take(&mut self.input).begin_frame(new_raw_input);
|
||||
|
||||
if let Some(new_pixels_per_point) = self.memory.new_pixels_per_point.take() {
|
||||
input.pixels_per_point = new_pixels_per_point;
|
||||
self.input.pixels_per_point = new_pixels_per_point;
|
||||
}
|
||||
|
||||
self.input = input.begin_frame(new_raw_input);
|
||||
self.frame_state.begin_frame(&self.input);
|
||||
|
||||
self.update_fonts_mut();
|
||||
|
|
Loading…
Reference in a new issue