MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / calcMapToTextTransform

Method calcMapToTextTransform

src/core/objects/text_object.cpp:289–301  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

287}
288
289QTransform TextObject::calcMapToTextTransform() const
290{
291 const TextSymbol* text_symbol = reinterpret_cast<const TextSymbol*>(symbol);
292
293 QTransform transform;
294 double scaling = 1.0f / text_symbol->calculateInternalScaling();
295 transform.scale(1.0f / scaling, 1.0f / scaling);
296 if (getRotation() != 0)
297 transform.rotate(-qRadiansToDegrees(getRotation()));
298 transform.translate(-coords[0].x(), -coords[0].y());
299
300 return transform;
301}
302
303void TextObject::setText(const QString& text)
304{

Callers 1

Calls 6

xMethod · 0.80
yMethod · 0.80
scaleMethod · 0.45
rotateMethod · 0.45
translateMethod · 0.45

Tested by

no test coverage detected