mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-04 19:40:53 +01:00
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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user