Repository navigation
Conversation
Scan positions are physical pixels; the overlay page converted them to CSS pixels with SettingsVM.ScreenScale, which is the game display's DPI, a custom display-scale override, or even an unsaved settings draft. The overlay's CSS pixels follow the overlay window's DPI instead, so on mixed-DPI setups or with a custom scale, tooltips drifted away from the item (growing with distance from the virtual-screen origin). VirtualScreenOffset was also computed once at startup and went stale when monitors changed, while the window itself was re-sized every show. - The overlay records its virtual-screen origin and GetDpiForWindow scale every time it is sized for a tooltip, and on DpiChanged. - The overlay page scales by that DPI and re-renders when it changes. Claude-Session: https://claude.ai/code/session_01QFKiA2aswHyp8SnpraLxE2
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 37 minutes. View limit details
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Users report scan overlays "off by a bit". Scan positions are physical pixels; the overlay page divided them by
SettingsVM.ScreenScale, which is the game display's DPI, a custom display-scale override, or the unsaved settings draft (UpdateDisplayPreviewwrites it live). WebView2's CSS pixels follow the overlay window's DPI. Whenever those differ (mixed-DPI monitors, custom scale, editing display settings) tooltips drift, more the further from the virtual-screen origin.VirtualScreenOffsetwas also computed once at startup, while the window is re-sized on every show, so monitor changes broke the origin.What
VirtualScreenOffsetbecomes a live mapping: origin +DeviceScale, updated by the overlay on every tooltip show (GetDpiForWindowafterSetWindowPos) and onDpiChanged; raisesChangedonly on real changes.VirtualScreenOffset.DeviceScaleand re-renders onChanged; it no longer depends onSettingsVM.VirtualScreenBoundsreplaces the two copies of the bounds loop.Validation
VirtualScreenOffsetTests: bounds with monitors left/above the primary, update + single notification (dedupe mutation fails it), DPI-only change, invalid scale fallback, contract that the overlay no longer readsScreenScale.dotnet test412/412;verify.ps1 -Mode Ui2/2; CodeRabbit: no findings.Not proven
https://claude.ai/code/session_01QFKiA2aswHyp8SnpraLxE2