Function tiny_skia::painter::is_too_big_for_math

source ยท
pub(crate) fn is_too_big_for_math(path: &Path) -> bool
Expand description

Sometimes in the drawing pipeline, we have to perform math on path coordinates, even after the path is in device-coordinates. Tessellation and clipping are two examples. Usually this is pretty modest, but it can involve subtracting/adding coordinates, or multiplying by small constants (e.g. 2,3,4). To try to preflight issues where these optionations could turn finite path values into infinities (or NaNs), we allow the upper drawing code to reject the path if its bounds (in device coordinates) is too close to max float.