Krita Source Code Documentation
Loading...
Searching...
No Matches
KoSvgText::CharTransformation Struct Reference

#include <KoSvgText.h>

+ Inheritance diagram for KoSvgText::CharTransformation:

Public Member Functions

QPointF absolutePos () const
 
bool hasRelativeOffset () const
 
bool isNull () const
 
void mergeInParentTransformation (const CharTransformation &t)
 
bool operator== (const CharTransformation &other) const
 
QPointF relativeOffset () const
 
bool startsNewChunk () const
 

Public Attributes

boost::optional< qreal > dxPos
 
boost::optional< qreal > dyPos
 
boost::optional< qreal > rotate
 
boost::optional< qreal > xPos
 
boost::optional< qreal > yPos
 

Detailed Description

Definition at line 603 of file KoSvgText.h.

Member Function Documentation

◆ absolutePos()

QPointF KoSvgText::CharTransformation::absolutePos ( ) const

Definition at line 346 of file KoSvgText.cpp.

347{
348 QPointF result;
349
350 if (xPos) {
351 result.rx() = *xPos;
352 }
353
354 if (yPos) {
355 result.ry() = *yPos;
356 }
357
358 return result;
359}
boost::optional< qreal > yPos
Definition KoSvgText.h:606
boost::optional< qreal > xPos
Definition KoSvgText.h:605

References xPos, and yPos.

◆ hasRelativeOffset()

bool KoSvgText::CharTransformation::hasRelativeOffset ( ) const

Definition at line 341 of file KoSvgText.cpp.

342{
343 return dxPos || dyPos;
344}
boost::optional< qreal > dxPos
Definition KoSvgText.h:607
boost::optional< qreal > dyPos
Definition KoSvgText.h:608

References dxPos, and dyPos.

◆ isNull()

bool KoSvgText::CharTransformation::isNull ( ) const

Definition at line 331 of file KoSvgText.cpp.

332{
333 return !xPos && !yPos && !dxPos && !dyPos && !rotate;
334}
boost::optional< qreal > rotate
Definition KoSvgText.h:609

References dxPos, dyPos, rotate, xPos, and yPos.

◆ mergeInParentTransformation()

void KoSvgText::CharTransformation::mergeInParentTransformation ( const CharTransformation & t)

Definition at line 308 of file KoSvgText.cpp.

309{
310 if (!xPos && t.xPos) {
311 xPos = *t.xPos;
312 }
313
314 if (!yPos && t.yPos) {
315 yPos = *t.yPos;
316 }
317
318 if (!dxPos && t.dxPos) {
319 dxPos = *t.dxPos;
320 }
321
322 if (!dyPos && t.dyPos) {
323 dyPos = *t.dyPos;
324 }
325
326 if (!rotate && t.rotate) {
327 rotate = *t.rotate;
328 }
329}

References dxPos, dyPos, rotate, xPos, and yPos.

◆ operator==()

bool KoSvgText::CharTransformation::operator== ( const CharTransformation & other) const

Definition at line 376 of file KoSvgText.cpp.

376 {
377 return
378 xPos == other.xPos && yPos == other.yPos &&
379 dxPos == other.dxPos && dyPos == other.dyPos &&
380 rotate == other.rotate;
381}

References dxPos, dyPos, rotate, xPos, and yPos.

◆ relativeOffset()

QPointF KoSvgText::CharTransformation::relativeOffset ( ) const

Definition at line 361 of file KoSvgText.cpp.

362{
363 QPointF result;
364
365 if (dxPos) {
366 result.rx() = *dxPos;
367 }
368
369 if (dyPos) {
370 result.ry() = *dyPos;
371 }
372
373 return result;
374}

References dxPos, and dyPos.

◆ startsNewChunk()

bool KoSvgText::CharTransformation::startsNewChunk ( ) const

Definition at line 336 of file KoSvgText.cpp.

337{
338 return xPos || yPos;
339}

References xPos, and yPos.

Member Data Documentation

◆ dxPos

boost::optional<qreal> KoSvgText::CharTransformation::dxPos

Definition at line 607 of file KoSvgText.h.

◆ dyPos

boost::optional<qreal> KoSvgText::CharTransformation::dyPos

Definition at line 608 of file KoSvgText.h.

◆ rotate

boost::optional<qreal> KoSvgText::CharTransformation::rotate

Definition at line 609 of file KoSvgText.h.

◆ xPos

boost::optional<qreal> KoSvgText::CharTransformation::xPos

Definition at line 605 of file KoSvgText.h.

◆ yPos

boost::optional<qreal> KoSvgText::CharTransformation::yPos

Definition at line 606 of file KoSvgText.h.


The documentation for this struct was generated from the following files: