label

class janim.gui.label.PixelRange(left: 'float', width: 'float')

基类:object

left: float
width: float
property right: float
class janim.gui.label.Label(name: str, t_range: TimeRange, *, pen=PenStyle.NoPen, brush=BrushStyle.NoBrush, font: QFont | None = None)

基类:object

shift_time_range(delta: float) None
property y: int
property height: int
property all_downs: list[Label]
class PaintParams(rect: 'QRect', range: 'TimeRange', y_pixel_offset: 'float')

基类:object

rect: QRect
range: TimeRange
y_pixel_offset: float
static time_range_to_pixel_range(params: PaintParams, t_range: TimeRange) PixelRange
paint(p: QPainter, params: PaintParams, y_offset: int) None
class janim.gui.label.LabelGroup(name: str, t_range: TimeRange, *labels: Label, collapse: bool, header: bool, pen=PenStyle.NoPen, brush=BrushStyle.NoBrush, highlight_pen=PenStyle.NoPen, highlight_brush=BrushStyle.NoBrush, skip_grouponly_query=False)

基类:Label

header_height_expanded = 2
shift_time_range(delta: float) None
init_labels(labels: Iterable[Label]) None
is_exclusive() bool

labels 没有重叠部分则返回 True

property height: int
switch_collapse() None
update_font() None
static get_smaller_font() QFont
mark_needs_refresh_height() None
property header_height: int
class QueryPolicy(*values)

基类:Enum

HeaderAndLabel = 0
GroupOnly = 1
HeaderOnly = 2
query_at(rect: QRect, display_range: TimeRange, pos: QPointF, y_pixel_offset: float, policy: QueryPolicy) Label | LabelGroup | None
find_before(t: float) Label | None
find_after(t: float) Label | None
static get_pix_collapse_tip1() QPixmap
static get_pix_collapse_tip2() QPixmap
paint(p: QPainter, params: PaintParams, y_offset: int = 0) None
compute_absolute_y() int
paint_highlight(p: QPainter, params: PaintParams) None
class janim.gui.label.LazyLabelGroup(name: str, t_range: TimeRange, make_labels_callback: Callable[[], Iterable[Label]], **kwargs)

基类:LabelGroup

switch_collapse() None