From 5bc2d5d1e8c401a06ff8a8c14d8f3b1f234c515a Mon Sep 17 00:00:00 2001 From: Aleksei Kanash Date: Thu, 13 Sep 2012 13:03:00 +0300 Subject: [PATCH] Fixed imported fro, iwb text size. Corrected imported text position. Strokes for lines and polygons has the same color as fill color. --- plugins/cffadaptor/src/UBCFFAdaptor.cpp | 3 +++ src/adaptors/UBCFFSubsetAdaptor.cpp | 14 +++++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/plugins/cffadaptor/src/UBCFFAdaptor.cpp b/plugins/cffadaptor/src/UBCFFAdaptor.cpp index 3ddceb7d..5630c01d 100644 --- a/plugins/cffadaptor/src/UBCFFAdaptor.cpp +++ b/plugins/cffadaptor/src/UBCFFAdaptor.cpp @@ -1794,6 +1794,7 @@ bool UBCFFAdaptor::UBToCFFConverter::parseUBZPolygon(const QDomElement &element, if (setCommonAttributesFromUBZ(element, iwbElementPart, svgElementPart)) { + svgElementPart.setAttribute(aStroke, svgElementPart.attribute(aFill)); addSVGElementToResultModel(svgElementPart, dstSvgList, getElementLayer(element)); if (0 < iwbElementPart.attributes().count()) @@ -1827,6 +1828,7 @@ bool UBCFFAdaptor::UBToCFFConverter::parseUBZPolyline(const QDomElement &element if (setCommonAttributesFromUBZ(element, iwbElementPart, svgElementPart)) { + svgElementPart.setAttribute(aStroke, svgElementPart.attribute(aFill)); addSVGElementToResultModel(svgElementPart, dstSvgList, getElementLayer(element)); if (0 < iwbElementPart.attributes().count()) @@ -1859,6 +1861,7 @@ bool UBCFFAdaptor::UBToCFFConverter::parseUBZLine(const QDomElement &element, QM if (setCommonAttributesFromUBZ(element, iwbElementPart, svgElementPart)) { + svgElementPart.setAttribute(aStroke, svgElementPart.attribute(aFill)); addSVGElementToResultModel(svgElementPart, dstSvgList, getElementLayer(element)); if (0 < iwbElementPart.attributes().count()) diff --git a/src/adaptors/UBCFFSubsetAdaptor.cpp b/src/adaptors/UBCFFSubsetAdaptor.cpp index 0bf967f7..f156e4c5 100644 --- a/src/adaptors/UBCFFSubsetAdaptor.cpp +++ b/src/adaptors/UBCFFSubsetAdaptor.cpp @@ -547,7 +547,7 @@ void UBCFFSubsetAdaptor::UBCFFSubsetReader::readTextCharAttr(const QDomElement & { QString fontSz = element.attribute(aFontSize); if (!fontSz.isNull()) { - qreal fontSize = fontSz.toDouble() * 72 / QApplication::desktop()->physicalDpiY(); + qreal fontSize = fontSz.remove("pt").toDouble(); format.setFontPointSize(fontSize); } QString fontColorText = element.attribute(aFill); @@ -712,12 +712,14 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgTextarea(const QDomElement & blockFormat.setAlignment(Qt::AlignLeft); QTextCharFormat textFormat; - textFormat.setFontPointSize(12 * 72 / QApplication::desktop()->physicalDpiY()); + // default values + textFormat.setFontPointSize(12); textFormat.setForeground(qApp->palette().foreground().color()); textFormat.setFontFamily("Arial"); textFormat.setFontItalic(false); textFormat.setFontWeight(QFont::Normal); + // readed values readTextBlockAttr(element, blockFormat); readTextCharAttr(element, textFormat); @@ -1140,7 +1142,13 @@ void UBCFFSubsetAdaptor::UBCFFSubsetReader::repositionSvgItem(QGraphicsItem *ite QTransform tr = item->sceneTransform(); item->setTransform(rTransform.scale(fullScaleX, fullScaleY), true); tr = item->sceneTransform(); - QPoint pos ((int)((x + mShiftVector.x() + (newVector - oldVector).x()) * mVBTransFactor), (int)((y +mShiftVector.y() + (newVector - oldVector).y()) * mVBTransFactor)); + QPoint pos; + if (UBGraphicsTextItem::Type == item->type()) + pos = QPoint((int)((x + mShiftVector.x() + (newVector - oldVector).x())), (int)((y +mShiftVector.y() + (newVector - oldVector).y()) * mVBTransFactor)); + else + pos = QPoint((int)((x + mShiftVector.x() + (newVector - oldVector).x()) * mVBTransFactor), (int)((y +mShiftVector.y() + (newVector - oldVector).y()) * mVBTransFactor)); + + item->setPos(pos); }