mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-23 02:10:52 +01:00
element-editor: limit decimal places for sizes and positions to two, when saving file
This commit is contained in:
@@ -101,11 +101,14 @@ const QDomElement PartText::toXml(QDomDocument &xml_document) const
|
||||
{
|
||||
QDomElement xml_element = xml_document.createElement(xmlName());
|
||||
|
||||
xml_element.setAttribute("x", QString::number(pos().x()));
|
||||
xml_element.setAttribute("y", QString::number(pos().y()));
|
||||
qreal x = (qRound(pos().x() * 100.0) / 100.0);
|
||||
qreal y = (qRound(pos().y() * 100.0) / 100.0);
|
||||
qreal rot = (qRound(rotation() * 10.0) / 10.0);
|
||||
xml_element.setAttribute("x", QString::number(x));
|
||||
xml_element.setAttribute("y", QString::number(y));
|
||||
xml_element.setAttribute("text", toPlainText());
|
||||
xml_element.setAttribute("font", font().toString());
|
||||
xml_element.setAttribute("rotation", QString::number(rotation()));
|
||||
xml_element.setAttribute("rotation", QString::number(rot));
|
||||
xml_element.setAttribute("color", defaultTextColor().name());
|
||||
|
||||
return(xml_element);
|
||||
|
||||
Reference in New Issue
Block a user