Skip to content

Commit

Permalink
set pixel ratio in imgui renderer for each render (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
kushalkolar authored Sep 4, 2024
1 parent 62a1a02 commit dba9e11
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions wgpu/utils/imgui/imgui_renderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ def render(self):
imgui.set_current_context(self.imgui_context)
draw_data = self._update_gui_function()

pixel_ratio = self._canvas_context.canvas.get_pixel_ratio()
self._backend.io.display_framebuffer_scale = (pixel_ratio, pixel_ratio)

command_encoder = self._backend._device.create_command_encoder()
current_texture_view = self._canvas_context.get_current_texture().create_view()
render_pass = command_encoder.begin_render_pass(
Expand Down

0 comments on commit dba9e11

Please sign in to comment.