def transformBy(self, matrix, origin=None): """ Transform the object. >>> obj.transformBy((0.5, 0, 0, 2.0, 10, 0)) >>> obj.transformBy((0.5, 0, 0, 2.0, 10, 0), origin=(500, 500)) **matrix** must be a :ref:`type-transformation`. **origin** defines the point at with the transformation should originate. It must be a :ref:`type-coordinate` or ``None``. The default is ``(0, 0)``. """ matrix = normalizers.normalizeTransformationMatrix(matrix) if origin is None: origin = (0, 0) origin = normalizers.normalizeCoordinateTuple(origin) if origin is not None: t = transform.Transform() oX, oY = origin t = t.translate(oX, oY) t = t.transform(matrix) t = t.translate(-oX, -oY) matrix = tuple(t) self._transformBy(matrix)
def transformBy(self, matrix, origin=None): """ Transform the object. >>> obj.transformBy((0.5, 0, 0, 2.0, 10, 0)) >>> obj.transformBy((0.5, 0, 0, 2.0, 10, 0), origin=(500, 500)) **matrix** must be a :ref:`type-transformation`. **origin** defines the point at with the transformation should originate. It must be a :ref:`type-coordinate` or ``None``. The default is ``(0, 0)``. """ matrix = normalizers.normalizeTransformationMatrix(matrix) if origin is None: origin = (0, 0) origin = normalizers.normalizeCoordinateTuple(origin) if origin is not None: t = transform.Transform() oX, oY = origin t = t.translate(oX, oY) t = t.transform(matrix) t = t.translate(-oX, -oY) matrix = tuple(t) self._transformBy(matrix)
def _set_base_transformation(self, value): value = normalizers.normalizeTransformationMatrix(value) self._set_transformation(value)
def _get_base_transformation(self): value = self._get_transformation() value = normalizers.normalizeTransformationMatrix(value) return value
def _set_base_transformation(self, value): value = normalizers.normalizeTransformationMatrix(value) self._set_transformation(value)
def _get_base_transformation(self): value = self._get_transformation() value = normalizers.normalizeTransformationMatrix(value) return value