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>
#include <KoColorDisplayRendererInterface.h>

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 85 of file KoSvgTextShapeOutlineHelper.cpp.

85 {
86 QList<QLineF> lines;
87 if (areas.size() <= 1) return lines;
88 for (int i = 1; i < areas.size(); i++) {
89 const QPainterPath previous = areas.at(i-1);
90 const QPainterPath next = areas.at(i);
91 const bool overlap = previous.intersects(next);
92 QLineF arrow(previous.boundingRect().center(), next.boundingRect().center());
93 if (!overlap) {
94
95 Q_FOREACH (QPolygonF p, previous.toSubpathPolygons()) {
96 if (p.size() == 1) continue;
97 for (int j = 1; j < p.size(); j++) {
98 QLineF l2(p.at(j-1), p.at(j));
99 QPointF intersect;
100 if (l2.intersects(arrow, &intersect) == QLineF::BoundedIntersection) {
101 arrow.setP1(intersect);
102 break;
103 }
104 }
105 }
106 Q_FOREACH (QPolygonF p, next.toSubpathPolygons()) {
107 if (p.size() == 1) continue;
108 for (int j = 1; j < p.size(); j++) {
109 QLineF l2(p.at(j-1), p.at(j));
110 QPointF intersect;
111 if (l2.intersects(arrow, &intersect) == QLineF::BoundedIntersection) {
112 arrow.setP2(intersect);
113 break;
114 }
115 }
116 }
117
118 }
119 lines.append(arrow);
120 }
121 return lines;
122}
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 22 of file KoSvgTextShapeOutlineHelper.cpp.

◆ BUTTON_ICON_SIZE

const int BUTTON_ICON_SIZE = 16

Definition at line 20 of file KoSvgTextShapeOutlineHelper.cpp.

◆ BUTTON_PADDING

const int BUTTON_PADDING = 4

Definition at line 21 of file KoSvgTextShapeOutlineHelper.cpp.

◆ ICON_ENTER

const QString ICON_ENTER = "object-group-calligra"

Definition at line 24 of file KoSvgTextShapeOutlineHelper.cpp.

◆ ICON_EXIT

const QString ICON_EXIT = "object-ungroup-calligra"

Definition at line 23 of file KoSvgTextShapeOutlineHelper.cpp.