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:
@@ -126,8 +126,10 @@ const QDomElement PartPolygon::toXml(QDomDocument &xml_document) const
|
||||
int i = 1;
|
||||
foreach(QPointF point, m_polygon) {
|
||||
point = mapToScene(point);
|
||||
xml_element.setAttribute(QString("x%1").arg(i), QString("%1").arg(point.x()));
|
||||
xml_element.setAttribute(QString("y%1").arg(i), QString("%1").arg(point.y()));
|
||||
qreal x = ((qRound(point.x() * 100.0)) / 100.0);
|
||||
qreal y = ((qRound(point.y() * 100.0)) / 100.0);
|
||||
xml_element.setAttribute(QString("x%1").arg(i), QString("%1").arg(x));
|
||||
xml_element.setAttribute(QString("y%1").arg(i), QString("%1").arg(y));
|
||||
++ i;
|
||||
}
|
||||
if (!m_closed) xml_element.setAttribute("closed", "false");
|
||||
|
||||
Reference in New Issue
Block a user