Skip to content

ScaledTextFieldLeft

src.text_layers.ScaledTextFieldLeft

Bases: TextField

A TextField which automatically scales down its font size until the left bound no longer overlaps with the reference layer's right bound.

Source code in src\text_layers.py
232
233
234
235
236
237
238
239
240
241
class ScaledTextFieldLeft (TextField):
    """A TextField which automatically scales down its font size until the left bound
        no longer overlaps with the `reference` layer's right bound."""

    def execute(self):
        super().execute()

        # Scale down the text layer until it doesn't overlap with a reference layer
        if self.reference:
            scale_text_left_overlap(self.layer, self.reference)