S or /

SourceClass Rangef

from egui import Rangef
class Rangef:

Inclusive range of floats, i.e. min..=max, but more ergonomic than RangeInclusive.

Constants§

EVERYTHING: Final[Rangef]§
NAN: Final[Rangef]§
NOTHING: Final[Rangef]§

Properties§

@property def max(self, /) -> float§
@max.setter def max(self, /, max: float) -> None§
@property def min(self, /) -> float§
@min.setter def min(self, /, min: float) -> None§

Methods§

Sourcedef as_positive(self, /) -> Rangef§

Flip min and max if needed, so that min <= max after.

Sourcedef center(self, /) -> float§

The center of the range

Sourcedef clamp(self, /, x: float) -> float§

Equivalent to x.clamp(min, max)

Sourcedef contains(self, /, x: float) -> bool§
Sourcedef expand(self, /, amount: float) -> Rangef§

Expand by this much on each side, keeping the center

Sourcedef flip(self, /) -> Rangef§

Flip the min and the max

Sourcedef intersection(self, /, other: Rangef) -> Rangef§

The overlap of two ranges, i.e. the range that is contained by both.

If the ranges do not overlap, returns a range with span() < 0.0.

Sourcedef intersects(self, /, other: Rangef) -> bool§

Do the two ranges intersect?

Source@staticmethod def point(min_and_max: float) -> Rangef§
Sourcedef shrink(self, /, amount: float) -> Rangef§

Shrink by this much on each side, keeping the center

Sourcedef span(self, /) -> float§

The length of the range, i.e. max - min.

def to_tuple(self, /) -> tuple[float, float]§