Skip to main content

sync_background_tile_scale

Function sync_background_tile_scale 

Source
pub fn sync_background_tile_scale(
    nodes: Query<'_, '_, (&ComputedNode, &BackgroundTileScale, &mut ImageNode), Or<(Changed<ComputedNode>, Changed<BackgroundTileScale>, Changed<ImageNode>)>>,
)
Expand description

Keep a repeat-mode background’s stretch_value equal to scale × scale factor, so scale: 1 tiles at the texture’s own size in logical px on every display (CSS semantics; bevy’s tiling is in physical terms). Reacts to Changed<ImageNode> too — every restyle (delta, hover flip) re-inserts the node with the logical value — and settles via compare-before-write (the corrected write’s own Changed echo no-ops on the next pass).