Sketcher, 0000466: improve visualization of constraints

This commit is contained in:
mrlukeparry
2012-07-15 13:23:59 +02:00
committed by logari81
parent e5953cedac
commit da7528c5b9
5 changed files with 697 additions and 359 deletions

View File

@@ -51,7 +51,8 @@ Constraint::Constraint()
SecondPos(none),
Third(GeoUndef),
ThirdPos(none),
LabelDistance(10.f)
LabelDistance(10.f),
LabelPosition(0.f)
{
}
@@ -65,7 +66,8 @@ Constraint::Constraint(const Constraint& from)
SecondPos(from.SecondPos),
Third(from.Third),
ThirdPos(from.ThirdPos),
LabelDistance(from.LabelDistance)
LabelDistance(from.LabelDistance),
LabelPosition(from.LabelPosition)
{
}
@@ -100,7 +102,8 @@ void Constraint::Save (Writer &writer) const
<< "SecondPos=\"" << (int) SecondPos << "\" "
<< "Third=\"" << Third << "\" "
<< "ThirdPos=\"" << (int) ThirdPos << "\" "
<< "LabelDistance=\"" << LabelDistance<< "\" />"
<< "LabelDistance=\"" << LabelDistance << "\" "
<< "LabelPosition=\"" << LabelPosition << "\" />"
<< std::endl;
}
@@ -123,4 +126,7 @@ void Constraint::Restore(XMLReader &reader)
// Read the distance a constraint label has been moved
if (reader.hasAttribute("LabelDistance"))
LabelDistance = (float)reader.getAttributeAsFloat("LabelDistance");
if (reader.hasAttribute("LabelPosition"))
LabelPosition = (float)reader.getAttributeAsFloat("LabelPosition");
}