def testSvgAnnotation(self): """ test rendering a svg annotation""" a = QgsSvgAnnotation() a.setFrameSize(QSizeF(300, 200)) a.setFrameOffsetFromReferencePoint(QPointF(40, 50)) svg = TEST_DATA_DIR + "/sample_svg.svg" a.setFilePath(svg) im = self.renderAnnotation(a, QPointF(20, 30)) self.assertTrue(self.imageCheck('svg_annotation', 'svg_annotation', im))
def testSvgAnnotation(self): """ test rendering a svg annotation""" a = QgsSvgAnnotation() a.fillSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0)) a.markerSymbol().symbolLayer(0).setStrokeColor(QColor(0, 0, 0)) a.setFrameSize(QSizeF(300, 200)) a.setFrameOffsetFromReferencePoint(QPointF(40, 50)) svg = TEST_DATA_DIR + "/sample_svg.svg" a.setFilePath(svg) im = self.renderAnnotation(a, QPointF(20, 30)) self.assertTrue(self.imageCheck('svg_annotation', 'svg_annotation', im)) # check clone clone = a.clone() im = self.renderAnnotation(a, QPointF(20, 30)) self.assertTrue(self.imageCheck('svg_annotation', 'svg_annotation', im))