Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the return of odd numbered pixels #132

Merged
merged 2 commits into from
Dec 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions addons/gst-web/src/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -535,8 +535,8 @@ class Input {

getWindowResolution() {
return [
parseInt((document.body.offsetWidth - document.body.offsetWidth%2) * window.devicePixelRatio),
parseInt((document.body.offsetHeight - document.body.offsetHeight%2) * window.devicePixelRatio)
parseInt( (() => {var offsetRatioWidth = document.body.offsetWidth * window.devicePixelRatio; return offsetRatioWidth - offsetRatioWidth % 2})() ),
parseInt( (() => {var offsetRatioHeight = document.body.offsetHeight * window.devicePixelRatio; return offsetRatioHeight - offsetRatioHeight % 2})() )
];
}
}
Expand All @@ -562,4 +562,4 @@ function addListener(obj, name, func, ctx) {
function removeListeners(listeners) {
for (const listener of listeners)
listener[0].removeEventListener(listener[1], listener[2]);
}
}