[Android] resize_android_corner_labels never refreshes Text2d content — stale rank/suit on resize #6
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
On Android (PNG card image path), each card has two child entities for the large-print corner overlay:
AndroidCornerBg— solid background spriteAndroidCornerLabel—Text2dnode showing rank + suit (e.g.A♥)The system
resize_android_corner_labels(fired whenLayoutResourcechanges) updates theTextFontsize andTransformposition of everyAndroidCornerLabelentity — but never updates theText2dtext content.Affected file
solitaire_engine/src/card_plugin.rs—resize_android_corner_labels(~line 2089)Reproduction
update_card_entitydespawn/respawn cycle.Root Cause
update_card_entitycorrectly despawns and re-spawns children (includingAndroidCornerLabel) on everyStateChangedEvent.resize_android_corner_labelsruns on a separate trigger (LayoutResourcechange) and only mutatesTextFontandTransform— it has no access to the parent card's identity and therefore cannot update the text.In practice this race window is very narrow (layout change must coincide with a card move in the same frame), but it is a correctness bug.
Suggested Fix
Change
resize_android_corner_labelsto also query the parentCardEntitycomponent (viaChildOf) and re-derive the label text from the card's rank and suit, ensuring the text content stays in sync even on the resize path.