MCPcopy Create free account
hub / github.com/SpaceZephyr/myskill / detect_frame_overflow

Function detect_frame_overflow

pptx/scripts/replace.py:143–159  ·  view source on GitHub ↗

Detect text overflow in shapes (text exceeding shape bounds). Returns dict of slide_key -> shape_key -> overflow_inches. Only includes shapes that have text overflow.

(inventory: InventoryData)

Source from the content-addressed store, hash-verified

141
142
143def detect_frame_overflow(inventory: InventoryData) -> Dict[str, Dict[str, float]]:
144 """Detect text overflow in shapes (text exceeding shape bounds).
145
146 Returns dict of slide_key -> shape_key -> overflow_inches.
147 Only includes shapes that have text overflow.
148 """
149 overflow_map = {}
150
151 for slide_key, shapes_dict in inventory.items():
152 for shape_key, shape_data in shapes_dict.items():
153 # Check for frame overflow (text exceeding shape bounds)
154 if shape_data.frame_overflow_bottom is not None:
155 if slide_key not in overflow_map:
156 overflow_map[slide_key] = {}
157 overflow_map[slide_key][shape_key] = shape_data.frame_overflow_bottom
158
159 return overflow_map
160
161
162def validate_replacements(inventory: InventoryData, replacements: Dict) -> List[str]:

Callers 1

apply_replacementsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected