2.2.5. Fixed Elements in the Dynamic Layout (layout.managers.fixed)

class layout.managers.fixed.AbsolutePositionLM

Bases: layout.managers.root.LayoutManager

A layout manager that positions it children at specific positions.

Because this layout manager basically ignores the size of the rectangle that it is given, it may draw content overlapping into surrounding content. It is common, therefore, to place this layout manager into one of the scaling layout managers in layout.managers.transform, to make sure it fits.

add_element(element, rect)

Sets the position of the given element. The same element can be added multiple times in different positions.

get_minimum_size()

How small can the element be? Should return a Point.

render(rectangle, data)

Asks the element to render itself.

class layout.managers.fixed.FixedSizeLM(size, element=None)

Bases: layout.managers.root.LayoutManager

A layout manager that always renders its children at a specific size, regardless of whether it is given enough room or not.

This layout manager is useful for displaying illustrations of a page within another page. It draws the inner page at a specific size.

Because this layout manager basically ignores the size of the rectangle that it is given, it may draw content overlapping into surrounding content. It is common, therefore, to place this layout manager into one of the scaling layout managers in layout.managers.transform, to make sure it fits.

get_minimum_size(data)

How small can the element be? Should return a Point.

render(rectangle, data)

Asks the element to render itself.