void TransformTest::testTransformTranslate() { MapCoord offset { 100.0, 100.0 }; QTransform qt; qt.translate(offset.x(), offset.y()); QVERIFY(qt.isTranslating()); QCOMPARE(int(qt.type()), int(QTransform::TxTranslate)); auto t = TemplateTransform::fromQTransform(qt); QCOMPARE(t.template_x, offset.nativeX()); QCOMPARE(t.template_y, offset.nativeY()); QCOMPARE(t.template_scale_x, 1.0); QCOMPARE(t.template_scale_y, 1.0); QCOMPARE(t.template_rotation, 0.0); }
/** * Compares a MapCoord and ClipperLib::IntPoint. */ bool operator==(const MapCoord& lhs, const ClipperLib::IntPoint& rhs) { return lhs.nativeX() == rhs.X && lhs.nativeY() == rhs.Y; }
void Template::setTemplatePosition(MapCoord coord) { transform.template_x = coord.nativeX(); transform.template_y = coord.nativeY(); updateTransformationMatrices(); }