Krita Source Code Documentation
Loading...
Searching...
No Matches
KoSvgTextShapeOutlineHelper.cpp File Reference
#include "KoSvgTextShapeOutlineHelper.h"
#include <KoCanvasBase.h>
#include <kis_icon.h>
#include <KoCanvasResourceProvider.h>
#include <KoSvgTextShape.h>
#include <KisHandlePainterHelper.h>
#include <KoShapeManager.h>
#include <KoSelection.h>
#include <QApplication>
#include <QPalette>

Go to the source code of this file.

Classes

struct  KoSvgTextShapeOutlineHelper::Private
 

Functions

QList< QLineF > getTextAreaOrderArrows (QList< QPainterPath > areas)
 

Variables

const int BUTTON_CORNER_ROUND = 1
 
const int BUTTON_ICON_SIZE = 16
 
const int BUTTON_PADDING = 4
 
const QString ICON_ENTER = "object-group-calligra"
 
const QString ICON_EXIT = "object-ungroup-calligra"
 

Function Documentation

◆ getTextAreaOrderArrows()

QList< QLineF > getTextAreaOrderArrows ( QList< QPainterPath > areas)

Definition at line 80 of file KoSvgTextShapeOutlineHelper.cpp.

80 {
81 QList<QLineF> lines;
82 if (areas.size() <= 1) return lines;
83 for (int i = 1; i < areas.size(); i++) {
84 const QPainterPath previous = areas.at(i-1);
85 const QPainterPath next = areas.at(i);
86 const bool overlap = previous.intersects(next);
87 QLineF arrow(previous.boundingRect().center(), next.boundingRect().center());
88 if (!overlap) {
89
90 Q_FOREACH (QPolygonF p, previous.toSubpathPolygons()) {
91 if (p.size() == 1) continue;
92 for (int j = 1; j < p.size(); j++) {
93 QLineF l2(p.at(j-1), p.at(j));
94 QPointF intersect;
95 if (l2.intersects(arrow, &intersect) == QLineF::BoundedIntersection) {
96 arrow.setP1(intersect);
97 break;
98 }
99 }
100 }
101 Q_FOREACH (QPolygonF p, next.toSubpathPolygons()) {
102 if (p.size() == 1) continue;
103 for (int j = 1; j < p.size(); j++) {
104 QLineF l2(p.at(j-1), p.at(j));
105 QPointF intersect;
106 if (l2.intersects(arrow, &intersect) == QLineF::BoundedIntersection) {
107 arrow.setP2(intersect);
108 break;
109 }
110 }
111 }
112
113 }
114 lines.append(arrow);
115 }
116 return lines;
117}
const Params2D p
QAction * next(const QObject *recvr, const char *slot, QObject *parent)

References p.

Variable Documentation

◆ BUTTON_CORNER_ROUND

const int BUTTON_CORNER_ROUND = 1

Definition at line 21 of file KoSvgTextShapeOutlineHelper.cpp.

◆ BUTTON_ICON_SIZE

const int BUTTON_ICON_SIZE = 16

Definition at line 19 of file KoSvgTextShapeOutlineHelper.cpp.

◆ BUTTON_PADDING

const int BUTTON_PADDING = 4

Definition at line 20 of file KoSvgTextShapeOutlineHelper.cpp.

◆ ICON_ENTER

const QString ICON_ENTER = "object-group-calligra"

Definition at line 23 of file KoSvgTextShapeOutlineHelper.cpp.

◆ ICON_EXIT

const QString ICON_EXIT = "object-ungroup-calligra"

Definition at line 22 of file KoSvgTextShapeOutlineHelper.cpp.