| 287 | } |
| 288 | |
| 289 | QTransform 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 | |
| 303 | void TextObject::setText(const QString& text) |
| 304 | { |
no test coverage detected