# Rendering problems

> The screen doesn't reflect the code — on-demand render, alpha, layout invalidation, weak GPU.

Source: https://crossfly.dev/docs/troubleshooting/render — CrossFly documentation. Full docs as one file: https://crossfly.dev/llms-full.txt

# Rendering problems

The screen doesn't reflect what the code did. Format: **symptom → cause → fix**.

## "I changed a value and the screen doesn't update"
**Cause:** rendering is **on-demand** — CrossFly only redraws when requested.
**Fix:** call `Component.repaint()`; if you changed size/position "from the outside", also
`setValidLayout(false)` (most framework setters already do this; what you change manually
does not). (Ch. 4 §4.6)

## Assigned color disappears / component becomes invisible
**Cause:** color is an `int` ARGB `0xAARRGGBB` and you used `0xRRGGBB` (alpha 0).
**Fix:** prefix with `0xFF…`.
```java
// 0x2196F3  → invisible (alpha 00)
// 0xFF2196F3 → opaque blue
```
(Ch. 11 — Colors)

## Layout doesn't recompute after swapping children
**Cause:** the layout wasn't invalidated.
**Fix:** `container.setValidLayout(false);` + `Component.repaint();`.

## UI stutters / jitters on an old device
**Cause:** weak GPU.
**Fix:** check **`Screen.slowGPU`** and reduce shadows/gradients/glass effect in that case.
(Ch. 8 — Rendering)

## Theme changed, but old components didn't
**Cause:** the style cache re-resolves via `styleVersion` (the `PalColor` colors re-resolve on the
next frame) — usually automatic on `setColorScheme`/`setDarkMode`.
**Fix:** if something didn't follow, force `restyle()` on the window or `Component.repaint()`.
([Light/dark mode](/docs/ui/theming/dark-mode))

## See also
- [Runtime errors](/docs/troubleshooting/runtime) · Concept: [The rendering pipeline](/docs/concepts/rendering-pipeline)
