Nettoyage d'une bidouille pour prendre en compte la precision lors d'une comparaison entre doubles

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@92 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavierqet
2007-04-16 18:00:18 +00:00
parent fc8b612f33
commit 8cb3499469

View File

@@ -773,11 +773,12 @@ bool Conducer::fromXml(QDomElement &e) {
QPointF t2 = terminal2 -> amarrageConducer();
qreal expected_width = qAbs(t2.x() - t1.x());
qreal expected_height = qAbs(t2.y() - t1.y());
qreal precision = std::numeric_limits<qreal>::epsilon();
if (
expected_width > width + 0.001 ||\
expected_width < width - 0.001 ||\
expected_height > height + 0.001 ||\
expected_height < height - 0.001
expected_width > width + precision ||\
expected_width < width - precision ||\
expected_height > height + precision ||\
expected_height < height - precision
) return(false);
/* on recree les segments a partir des donnes XML */