Skip to content

Commit 9522181

Browse files
committed
in demo, let ImGui handle pixel ratio
1 parent a5acd7b commit 9522181

8 files changed

Lines changed: 3642 additions & 3579 deletions

File tree

build/bind-imgui.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/imgui.umd.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/imgui_demo.umd.js

Lines changed: 3327 additions & 3305 deletions
Large diffs are not rendered by default.

dist/imgui_impl.umd.js

Lines changed: 157 additions & 136 deletions
Large diffs are not rendered by default.

dist/imgui_memory_editor.umd.js

Lines changed: 151 additions & 129 deletions
Large diffs are not rendered by default.

example/build/imgui_impl.js

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/build/imgui_impl.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

example/src/imgui_impl.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ function document_on_paste(event: ClipboardEvent): void {
4747

4848
function window_on_resize(): void {
4949
if (canvas !== null) {
50-
const devicePixelRatio: number = window.devicePixelRatio || 1;
51-
canvas.width = Math.floor(canvas.scrollWidth * devicePixelRatio);
52-
canvas.height = Math.floor(canvas.scrollHeight * devicePixelRatio);
50+
canvas.width = canvas.scrollWidth;
51+
canvas.height = canvas.scrollHeight;
5352
}
5453
}
5554

0 commit comments

Comments
 (0)