S or /

SourceClass MarginF32

from egui import MarginF32
class MarginF32:

A value for all four sides of a rectangle, often used to express padding or spacing.

Can be added and subtracted to/from Rects.

For storage, use egui.Margin instead.

Properties§

@property def bottom(self, /) -> float§
@bottom.setter def bottom(self, /, bottom: float) -> None§
@property def left(self, /) -> float§
@left.setter def left(self, /, left: float) -> None§
@property def right(self, /) -> float§
@right.setter def right(self, /, right: float) -> None§
@property def top(self, /) -> float§
@top.setter def top(self, /, top: float) -> None§

Methods§

def expand_rect(self, /, rect: Rect) -> Rect§
Sourcedef is_same(self, /) -> bool§

Are the margin on every side the same?

Sourcedef left_top(self, /) -> Vec2§
Sourcedef right_bottom(self, /) -> Vec2§
Source@staticmethod def same(margin: float) -> MarginF32§

The same margin on every side.

def shrink_rect(self, /, rect: Rect) -> Rect§
Sourcedef sum(self, /) -> Vec2§

Total margins on both sides

Source@staticmethod def symmetric(x: float, y: float) -> MarginF32§

Margins with the same size on opposing sides

@staticmethod def zero() -> MarginF32§