Function inflate_for_effects

Source
pub fn inflate_for_effects(bounds: Rect, effects: &IsolatedEffectChain) -> Rect
Expand description

Inflates bounds for every blur in an isolated effect chain.

Each blur adds radius_px * BLUR_PADDING_FACTOR independently on all sides. Negative or NaN radii are not sanitized here; budget planning must clamp inputs before this step.

ยงExamples

use ailloli_ui_core::Rect;
use ailloli_ui_render_wgpu::{cmd_bounds::inflate_for_effects, IsolatedEffect, IsolatedEffectChain};
let effects = IsolatedEffectChain { effects: vec![IsolatedEffect::Blur { radius_px: 2.0 }] };
assert_eq!(inflate_for_effects(Rect::new(10.0, 10.0, 20.0, 20.0), &effects),
    Rect::new(4.0, 4.0, 32.0, 32.0));