🐛 Fix text editor not repainting text if there was not a geometry change (#10553)

This commit is contained in:
Belén Albeza 2026-07-07 11:18:44 +02:00 committed by GitHub
parent c88d9f568b
commit 0a2570c9eb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -524,21 +524,26 @@ impl RenderState {
.is_some_and(|s| s.is_safe_for_drag_crop_cache(tree)); .is_some_and(|s| s.is_safe_for_drag_crop_cache(tree));
} }
// If the moving content overlaps this cached crop, do not use the cached pixels match moved_bounds {
// for this frame. We intentionally keep the cache entry: overlap is typically // Something is actually moving/resizing. If the moving content overlaps this
// transient during drag, and once the moving content leaves the area the crop // cached crop, do not use the cached pixels for this frame. We intentionally
// becomes valid again (stationary shape unchanged). // keep the cache entry: overlap is typically transient during drag, and once
if let Some(moved) = moved_bounds { // the moving content leaves the area the crop becomes valid again (stationary
let intersects = self // shape unchanged).
.backbuffer_crop_cache Some(moved) => {
.get(&node_id) let intersects = self
.is_some_and(|crop| moved.intersects(crop.src_doc_bounds)); .backbuffer_crop_cache
.get(&node_id)
if intersects { .is_some_and(|crop| moved.intersects(crop.src_doc_bounds));
return false; !intersects
} }
// Interactive-transform mode is active but nothing is moving (no modifiers):
// e.g. editing a text shape inside this board reflows its content without
// changing geometry. The cached crop was captured before the edit, so blitting
// it would paint stale pixels over the freshly rendered tiles. Render live.
None => false,
} }
true
} }
pub fn try_new(width: i32, height: i32) -> Result<RenderState> { pub fn try_new(width: i32, height: i32) -> Result<RenderState> {