MCPcopy Create free account
hub / github.com/Paper2Poster/Paper2Poster / center_shape_vertically

Function center_shape_vertically

utils/pptx_utils.py:1694–1702  ·  view source on GitHub ↗

Center a shape vertically on the slide using the presentation's slide height. :param prs: The Presentation object (which holds slide_height). :param shape: The shape to center.

(prs, shape)

Source from the content-addressed store, hash-verified

1692 shape.left = new_left
1693
1694def center_shape_vertically(prs, shape):
1695 """
1696 Center a shape vertically on the slide using the presentation's slide height.
1697
1698 :param prs: The Presentation object (which holds slide_height).
1699 :param shape: The shape to center.
1700 """
1701 new_top = (prs.slide_height - shape.height) // 2
1702 shape.top = new_top
1703
1704def set_shape_text(shape, text, clear_first=True):
1705 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected