Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix FS#831: unicode characters displayed on top of others

  • Loading branch information...
commit 51ae0e84e3f79533cd82d73aeae92528e70dcb6d 1 parent bda0029
Andrew Mustun authored
View
7 src/core/RPainterPathEngine.cpp
@@ -38,6 +38,11 @@ bool RPainterPathEngine::end() {
void RPainterPathEngine::updateState(const QPaintEngineState &state) {
QPaintEngine::DirtyFlags flags = state.state();
+ // required for Qt >= 4.8.0 for texts with unicode characters:
+ if (flags & DirtyTransform) {
+ transform = state.transform();
+ }
+
/*
QPaintEngine::DirtyFlags flags = state.state();
if (flags & DirtyPen) updatePen(state.pen());
@@ -72,6 +77,8 @@ void RPainterPathEngine::drawPath(const QPainterPath& qpath) {
if (state->brush().color().isValid()) {
path.setFixedBrushColor(true);
}
+ // required for Qt >= 4.8.0 for texts with unicode characters:
+ path.transform(transform);
paths.append(path);
}
View
1  src/core/RPainterPathEngine.h
@@ -55,6 +55,7 @@ class QCADCORE_EXPORT RPainterPathEngine : public QPaintEngine {
private:
QList<RPainterPath> paths;
+ QTransform transform;
};
#endif
View
14 src/entity/RTextData.cpp
@@ -596,6 +596,20 @@ QString RTextData::toEscapedText(const QTextDocument& textDocument, const RColor
text.replace(RTextRenderer::chPlusMinus, RTextRenderer::escPlusMinus);
// diameter:
text.replace(RTextRenderer::chDiameter, RTextRenderer::escDiameter);
+ /*
+ // unicode:
+ QString t;
+ for (int k=0; k<text.length(); k++) {
+ unsigned short c = text[k].unicode();
+ if (c>255) {
+ t.append(QString("\\U+%1").arg(c, 4, 16, QChar('0')));
+ }
+ else {
+ t += text[k];
+ }
+ }
+ text = t;
+ */
ret += text;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.