diff --git a/qad/graphic/graphic.cpp b/qad/graphic/graphic.cpp index 1143629..892a56e 100644 --- a/qad/graphic/graphic.cpp +++ b/qad/graphic/graphic.cpp @@ -1322,9 +1322,13 @@ void Graphic::tick(int index, bool slide, bool update_) { if (history > 0.) while (t.polyline.size() > 1) { if (fabs(t.polyline.back().x() - t.polyline.front().x()) <= history) break; + /// TODO: [Graphic] fast autofit while addPoint(double y, ...) if (!t.cvrect.isNull()) { - if (!t.cvrect.contains(t.polyline.first())) { - /// TODO: [Graphic] add smart remove for fast autofit + QPointF fp(t.polyline.first()); + if (qFuzzyCompare(t.cvrect.left(), fp.x()) || + qFuzzyCompare(t.cvrect.right(), fp.x()) || + qFuzzyCompare(t.cvrect.top(), fp.y()) || + qFuzzyCompare(t.cvrect.bottom(), fp.y())) { t.cvrect = QRectF(); } }