mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-04 19:40:53 +01:00
fix wrong position of segments when loading file. This was, because not the segment property is asked, but the parent and this will not work
additionally support legacy orientation
This commit is contained in:
@@ -1102,11 +1102,21 @@ bool Conductor::pathFromXml(const QDomElement &e) {
|
||||
|
||||
// le segment doit avoir une longueur
|
||||
qreal segment_length;
|
||||
if (propertyDouble(e, "length", & segment_length))
|
||||
if (propertyDouble(current_segment, "length", & segment_length))
|
||||
continue;
|
||||
|
||||
bool isHorizontal;
|
||||
propertyBool(e, "orientation", &isHorizontal);
|
||||
bool isHorizontal = false;
|
||||
if (propertyBool(current_segment, "orientation", &isHorizontal) == PropertyFlags::NoValidConversion) {
|
||||
// legacy
|
||||
QString orientation;
|
||||
if (propertyString(current_segment, "orientation", &orientation) == PropertyFlags::Success) {
|
||||
if (orientation == "horizontal")
|
||||
isHorizontal = true;
|
||||
} else {
|
||||
qDebug() << "PathFromXML failed";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (isHorizontal) {
|
||||
segments_x << segment_length;
|
||||
|
||||
Reference in New Issue
Block a user