A transformation that translates by *xt* and *yt*, after *xt* and *yt* have been transformed by *scale_trans*.
| 2698 | |
| 2699 | |
| 2700 | class ScaledTranslation(Affine2DBase): |
| 2701 | """ |
| 2702 | A transformation that translates by *xt* and *yt*, after *xt* and *yt* |
| 2703 | have been transformed by *scale_trans*. |
| 2704 | """ |
| 2705 | def __init__(self, xt, yt, scale_trans, **kwargs): |
| 2706 | super().__init__(**kwargs) |
| 2707 | self._t = (xt, yt) |
| 2708 | self._scale_trans = scale_trans |
| 2709 | self.set_children(scale_trans) |
| 2710 | self._mtx = None |
| 2711 | self._inverted = None |
| 2712 | |
| 2713 | __str__ = _make_str_method("_t") |
| 2714 | |
| 2715 | def get_matrix(self): |
| 2716 | # docstring inherited |
| 2717 | if self._invalid: |
| 2718 | # A bit faster than np.identity(3). |
| 2719 | self._mtx = IdentityTransform._mtx.copy() |
| 2720 | self._mtx[:2, 2] = self._scale_trans.transform(self._t) |
| 2721 | self._invalid = 0 |
| 2722 | self._inverted = None |
| 2723 | return self._mtx |
| 2724 | |
| 2725 | |
| 2726 | class _ScaledRotation(Affine2DBase): |
no test coverage detected
searching dependent graphs…