Exemple #1
0
    def test_transient_translate_operation(self):
        item = QgsAnnotationPointTextItem('my text', QgsPointXY(12, 13))
        self.assertEqual(item.point().asWkt(), 'POINT(12 13)')

        res = item.transientEditResults(QgsAnnotationItemEditOperationTranslateItem('', 100, 200))
        self.assertEqual(res.representativeGeometry().asWkt(), 'Point (112 213)')
Exemple #2
0
    def test_transient_move_operation(self):
        item = QgsAnnotationPointTextItem('my text', QgsPointXY(12, 13))
        self.assertEqual(item.point().asWkt(), 'POINT(12 13)')

        res = item.transientEditResults(QgsAnnotationItemEditOperationMoveNode('', QgsVertexId(0, 0, 0), QgsPoint(12, 13), QgsPoint(17, 18)))
        self.assertEqual(res.representativeGeometry().asWkt(), 'Point (17 18)')