Fix: Notifier aplica offset de viewport para consistencia en letterbox

Aplica el mismo patrón de viewport offset usado en TextRenderer
al renderizado del fondo de notificaciones para consistencia completa.

## Cambios

**notifier.cpp - renderBackground():**
- Obtener viewport ANTES de deshabilitar presentación lógica
- Aplicar offset del viewport a coordenadas del rectángulo:
  - `bg_rect.x = x + viewport.x`
  - `bg_rect.y = y + viewport.y`

## Resultado

 Fondo de notificaciones respeta offset de viewport
 Consistencia completa entre texto y fondo en modo letterbox
 Compatible con F3 (letterbox), F4 (stretch), y ventana normal

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-10 11:19:01 +02:00
parent 33728857ac
commit 5f89299444

View File

@@ -182,10 +182,16 @@ void Notifier::renderBackground(int x, int y, int width, int height, float alpha
return;
}
// Obtener viewport ANTES de deshabilitar presentación lógica
// En modo letterbox (F3), SDL crea un viewport con offset para centrar la imagen
SDL_Rect viewport;
SDL_GetRenderViewport(renderer_, &viewport);
// Crear rectángulo para el fondo (en coordenadas físicas)
// Aplicar offset del viewport para que el fondo se pinte dentro del área visible
SDL_FRect bg_rect;
bg_rect.x = static_cast<float>(x);
bg_rect.y = static_cast<float>(y);
bg_rect.x = static_cast<float>(x + viewport.x);
bg_rect.y = static_cast<float>(y + viewport.y);
bg_rect.w = static_cast<float>(width);
bg_rect.h = static_cast<float>(height);
@@ -202,7 +208,7 @@ void Notifier::renderBackground(int x, int y, int width, int height, float alpha
SDL_RendererLogicalPresentation presentation_mode;
SDL_GetRenderLogicalPresentation(renderer_, &logical_w, &logical_h, &presentation_mode);
// Renderizar sin presentación lógica (coordenadas físicas absolutas)
// Renderizar sin presentación lógica (coordenadas físicas absolutas con offset de viewport)
SDL_SetRenderLogicalPresentation(renderer_, 0, 0, SDL_LOGICAL_PRESENTATION_DISABLED);
SDL_RenderFillRect(renderer_, &bg_rect);