Giter VIP home page Giter VIP logo

Comments (6)

emilk avatar emilk commented on May 28, 2024

How are you using egui and epaint? Via eframe? What is your reproduce for this?

What the error message is trying to say is that the pixels_per_point passed to tessellate must match the pixels_per_point of the Fonts used during the frame.

from egui.

Axel-Reactor avatar Axel-Reactor commented on May 28, 2024

At the very least that error message should be fixed. It's extremely unhelpful.

We do not use eframe, it's a custom integration on top of a Vulkan renderer using winit. The only workaround I found is to do this:

        let mut raw_input = self.egui_winit.take_egui_input(window);
        raw_input.viewports.iter_mut().for_each(|viewport| {
            // Hack around bug with scale factor causing egui to crash in fonts lookup
            viewport.1.native_pixels_per_point = Some(1.0);
        });
        let egui::FullOutput { platform_output, textures_delta, shapes, pixels_per_point: _, viewport_output: _ } =
            self.egui_winit.egui_ctx().run(raw_input, run_ui);

That doesn't seem very nice.

from egui.

emilk avatar emilk commented on May 28, 2024

You should be using pixels_per_point returned in FullOutput: https://docs.rs/egui/latest/egui/struct.FullOutput.html#structfield.pixels_per_point

from egui.

Axel-Reactor avatar Axel-Reactor commented on May 28, 2024

@emilk That would give me >1x scaling which is not what I want.

from egui.

emilk avatar emilk commented on May 28, 2024

If you don't want egui scaling, then call ctx.set_zoom_factor(1.0); and turn off the zoom_with_keyboard option.

from egui.

Axel-Reactor avatar Axel-Reactor commented on May 28, 2024

Doesn't work. egui_winit forces the scale from the OS.

from egui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.