Skip to main content

apply_background_image

Function apply_background_image 

Source
pub fn apply_background_image(
    ec: &mut EntityCommands<'_>,
    style: &Option<Style>,
    dirty: StyleDirty,
    promoted: bool,
    assets: &AssetServer,
)
Expand description

Apply the style’s backgroundImage onto the entity: insert/update or remove the ImageNode (plus the RBackgroundTexture / BackgroundTileScale markers) per the spec. Skips entirely unless the BG_IMAGE group is dirty. Callers guarantee the entity’s ImageNode is not element-owned (see JsBridge::foreign_images); on a node that never had the style, the removes are no-ops (same pattern as the BackgroundColor arm in apply_style_masked).