Skip to content

fix(overlay): map tooltips with the overlay's own DPI and live origin - #77

Merged
DysektAI merged 5 commits into
masterfrom
fix/overlay-dpi-offset
Nov 2, 2026
Merged

DysektAI merged 5 commits into
masterfrom
fix/overlay-dpi-offset

Conversation

@DysektAI

@DysektAI DysektAI commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Problem and behavior

Scan positions are physical pixels, while the overlay WebView follows the overlay window's DPI. Using game-display settings or an unsaved settings preview to scale those coordinates shifts tooltips when those scales differ. A startup-only virtual-screen origin also becomes stale after monitors are rearranged.

  • Publish immutable origin/device-scale snapshots through VirtualScreenOffset, updated by the overlay after sizing for each tooltip show and on DpiChanged.
  • Scale overlay coordinates using its window-owned DeviceScale; subscribe to mapping changes and remove the SettingsVM.ScreenScale dependency.
  • Share virtual-screen bounds calculation and document DPI ownership and remaining topology limitations.

Validation

  • Final head 8b14f5f817ca3b3661f98761168204468eda773d incorporates master 80b7ee603205841a7d9d5c3a30cb57f291495f6d and its standalone engine revision without overlay conflicts.
  • Canonical scripts/verify.ps1 -Mode Fast: passed; Debug build 0 warnings/errors; 434 unit tests passed, 6 optional local-fixture tests skipped.
  • Release build: 0 warnings/errors; 434 unit tests passed, 6 optional local-fixture tests skipped.
  • Canonical scripts/verify.ps1 -Mode Ui: 2/2 hosted WebView smoke tests passed. Visually inspected desktop-scan.png and narrow-settings.png under artifacts/ui-tests/20261102-035839-45216-179a1178fe294d9b8e5bc61e75826625/.
  • Three behavioral mapping tests cover negative monitor origins, origin/DPI updates, notification deduplication, and invalid-scale fallback. Dedupe-bypass, invalid-scale-bypass, and frozen-DPI mutations each failed; restored tests passed.
  • Local CodeRabbit completed: two duplicate reports of a source-checkout-dependent test. Removed that source-parsing test; retained behavioral mapping tests. No production-code findings. No unresolved PR review threads at inspection.

Limits

  • UI smoke and screenshots exercise the general hosted UI; they do not assert overlay tooltip coordinates over a real scan.
  • Real EFT placement on 100%, 125/150%, and mixed-DPI monitors remains a manual validation gap.
  • Monitor topology changes while a tooltip stays continuously visible are not actively observed; mapping refreshes at the next show or DPI change. This pre-existing limitation is not expanded here.
  • Rotated-icon coordinate mapping belongs to a separate engine fix.

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
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 23 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 2 included reviews currently available. Your 56 included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 3fabd141-bb4f-4593-9d7f-056a489f98fb
Commits

Reviewing files that changed from the base of the PR and between 80b7ee6 and 8b14f5f.

Files selected for processing: 7
  • docs/agent-context/app-ui.md
  • src/App/Pages/Overlay/Index.razor
  • src/App/View/BlazorOverlay.xaml.cs
  • src/App/View/BlazorUI.xaml.cs
  • src/App/View/OverlayNativeMethods.cs
  • src/App/VirtualScreenOffset.cs
  • tests/RatScanner.Tests/VirtualScreenOffsetTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

1 participant