Skip to main content

checked_translate_coordinate

Function checked_translate_coordinate 

Source
pub fn checked_translate_coordinate(
    coordinate: IVec2,
    offset: IVec2,
) -> Result<IVec2, CoordinateOverflowError>
Expand description

Translate one coordinate without wrapping outside the signed 32-bit lattice.

ยงErrors

Returns CoordinateOverflowError if either translated component overflows.