mirror of
https://github.com/tumic0/QtPBFImagePlugin.git
synced 2024-12-04 16:39:10 +01:00
Compare commits
No commits in common. "b36fb5fa9272d56d342a9d6793b50121b9c5ce62" and "8cf73b5bb5047a678eb306d165b46750f09a153a" have entirely different histories.
b36fb5fa92
...
8cf73b5bb5
@ -1,4 +1,4 @@
|
|||||||
version: 2.6.{build}
|
version: 2.5.{build}
|
||||||
|
|
||||||
configuration:
|
configuration:
|
||||||
- Release
|
- Release
|
||||||
|
@ -2,7 +2,7 @@ TARGET = pbf
|
|||||||
TEMPLATE = lib
|
TEMPLATE = lib
|
||||||
CONFIG += plugin
|
CONFIG += plugin
|
||||||
QT += gui
|
QT += gui
|
||||||
VERSION = 2.6
|
VERSION = 2.5
|
||||||
|
|
||||||
PROTOS = protobuf/vector_tile.proto
|
PROTOS = protobuf/vector_tile.proto
|
||||||
include(protobuf/vector_tile.pri)
|
include(protobuf/vector_tile.pri)
|
||||||
|
@ -171,12 +171,6 @@ static QList<QPolygonF> polyLines(const QPainterPath &path, const QRectF &rect)
|
|||||||
return lines;
|
return lines;
|
||||||
}
|
}
|
||||||
|
|
||||||
static qreal diff(qreal a1, qreal a2)
|
|
||||||
{
|
|
||||||
qreal d = qAbs(a1 - a2);
|
|
||||||
return (d > 180) ? 360 - d : d;
|
|
||||||
}
|
|
||||||
|
|
||||||
static QPainterPath textPath(const QPainterPath &path, qreal textWidth,
|
static QPainterPath textPath(const QPainterPath &path, qreal textWidth,
|
||||||
qreal maxAngle, qreal charWidth, const QRectF &tileRect)
|
qreal maxAngle, qreal charWidth, const QRectF &tileRect)
|
||||||
{
|
{
|
||||||
@ -195,16 +189,11 @@ static QPainterPath textPath(const QPainterPath &path, qreal textWidth,
|
|||||||
qreal sl = l.length();
|
qreal sl = l.length();
|
||||||
qreal a = l.angle();
|
qreal a = l.angle();
|
||||||
|
|
||||||
if (sl < charWidth) {
|
if ((sl < charWidth) || (j > 1 && qAbs(angle - a) > maxAngle)) {
|
||||||
if (length > textWidth)
|
if (length > textWidth)
|
||||||
return subpath(pl, last, j - 1, length - textWidth);
|
return subpath(pl, last, j - 1, length - textWidth);
|
||||||
last = j;
|
last = j;
|
||||||
length = 0;
|
length = 0;
|
||||||
} else if (j > 1 && diff(angle, a) > maxAngle) {
|
|
||||||
if (length > textWidth)
|
|
||||||
return subpath(pl, last, j - 1, length - textWidth);
|
|
||||||
last = j - 1;
|
|
||||||
length = sl;
|
|
||||||
} else
|
} else
|
||||||
length += sl;
|
length += sl;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user