Skip to content

fix: touch scaling bug and initialize display variables as 0#4758

Draft
ReenigneArcher wants to merge 1 commit intomasterfrom
fix/double-offset
Draft

fix: touch scaling bug and initialize display variables as 0#4758
ReenigneArcher wants to merge 1 commit intomasterfrom
fix/double-offset

Conversation

@ReenigneArcher
Copy link
Member

Description

Initialize additional display_t members (env_width/env_height/env_logical_width/env_logical_height/width/height/logical_width/logical_height) in the constructor to ensure consistent defaults. Fix touch input scaling on Windows by removing a redundant addition of display offsets (preventing double-offsetting for multi-monitor setups) and adding a clarifying comment. Tighten the video coordinate check to use explicit >0 comparisons for logical/env sizes before computing scaling factors.

TODO:

  • Test to ensure no regressions on different platforms
    • Windows
    • Linux
    • macOS

Screenshot

Issues Fixed or Closed

Roadmap Issues

Type of Change

  • feat: New feature (non-breaking change which adds functionality)
  • fix: Bug fix (non-breaking change which fixes an issue)
  • docs: Documentation only changes
  • style: Changes that do not affect the meaning of the code (white-space, formatting, missing semicolons, etc.)
  • refactor: Code change that neither fixes a bug nor adds a feature
  • perf: Code change that improves performance
  • test: Adding missing tests or correcting existing tests
  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Other changes that don't modify src or test files
  • revert: Reverts a previous commit
  • BREAKING CHANGE: Introduces a breaking change (can be combined with any type above)

Checklist

  • Code follows the style guidelines of this project
  • Code has been self-reviewed
  • Code has been commented, particularly in hard-to-understand areas
  • Code docstring/documentation-blocks for new or existing methods/components have been added or updated
  • Unit tests have been added or updated for any new or modified functionality

AI Usage

  • None: No AI tools were used in creating this PR
  • Light: AI provided minor assistance (formatting, simple suggestions)
  • Moderate: AI helped with code generation or debugging specific parts
  • Heavy: AI generated most or all of the code changes

@codecov
Copy link

codecov bot commented Feb 22, 2026

Bundle Report

Bundle size has no change ✅

@codecov
Copy link

codecov bot commented Feb 22, 2026

Codecov Report

❌ Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (master@dad5039). Learn more about missing BASE report.
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/platform/windows/input.cpp 0.00% 2 Missing ⚠️
src/video.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##             master    #4758   +/-   ##
=========================================
  Coverage          ?   15.39%           
=========================================
  Files             ?       97           
  Lines             ?    20674           
  Branches          ?     9472           
=========================================
  Hits              ?     3183           
  Misses            ?    13814           
  Partials          ?     3677           
Flag Coverage Δ
Archlinux 11.04% <50.00%> (?)
FreeBSD-14.3-amd64 13.10% <91.66%> (?)
Homebrew-ubuntu-22.04 13.25% <50.00%> (?)
Linux-AppImage 11.45% <50.00%> (?)
Windows-AMD64 13.47% <25.00%> (?)
Windows-ARM64 12.38% <78.57%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
src/platform/common.h 33.92% <100.00%> (ø)
src/video.cpp 29.85% <0.00%> (ø)
src/platform/windows/input.cpp 0.58% <0.00%> (ø)

@ReenigneArcher ReenigneArcher force-pushed the fix/double-offset branch 3 times, most recently from f242ef3 to 619caf9 Compare February 22, 2026 18:59
Initialize additional display_t members (env_width/env_height/env_logical_width/env_logical_height/width/height/logical_width/logical_height) in the constructor to ensure consistent defaults. Fix touch input scaling on Windows by removing a redundant addition of display offsets (preventing double-offsetting for multi-monitor setups) and adding a clarifying comment. Tighten the video coordinate check to use explicit >0 comparisons for logical/env sizes before computing scaling factors.

Co-Authored-By: Chase Payne <27069224+nonary@users.noreply.github.com>
@sonarqubecloud
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Uninitialized display_t members cause garbage touch/absolute input on Windows

1 participant