Skip to content

Draw translation overlays correctly within the content viewport#18986

Merged
LibretroAdmin merged 1 commit intolibretro:masterfrom
adamschachne:fix-ai-service-overlay-viewport
Apr 28, 2026
Merged

Draw translation overlays correctly within the content viewport#18986
LibretroAdmin merged 1 commit intolibretro:masterfrom
adamschachne:fix-ai-service-overlay-viewport

Conversation

@adamschachne
Copy link
Copy Markdown
Contributor

Guidelines

  1. Rebase before opening a pull request
  2. If you are sending several unrelated fixes or features, use a branch and a separate pull request for each
  3. If possible try squashing everything in a single commit. This is particularly beneficial in the case of feature merges since it allows easy bisecting when a problem arises
  4. RetroArch codebase follows C89 coding rules for portability across many old platforms check using C89_BUILD=1

Description

I noticed that the AI service (image mode) translations were being drawn kind of strangely. The overlays were always being rendered full window dimensions. This caused incorrect placement when the game content viewport did not fill the full window, such as with a custom aspect ratio or with very wide/tall viewports (letterboxing).

This PR fixes those overlays by drawing them over the actual game/content viewport. The overlay drawing function now checks the current game video viewport and, when available, uses its x, y, width, and height. If viewport info is unavailable, it falls back to the previous full-output behavior.

Example of the behavior before (nightly 04-26-26) and after this change:

NVIDIA_Overlay_2026-04-28_03-18-33.mp4

Related Issues

should close both of these:
#15287
#12050

Related Pull Requests

none

Reviewers

[If possible @mention all the people that should review your pull request]

@LibretroAdmin LibretroAdmin merged commit 2d7b7ed into libretro:master Apr 28, 2026
39 of 40 checks passed
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.

2 participants