diff --git a/qad_graphic/graphic.cpp b/qad_graphic/graphic.cpp index 7bb4152..e09e19e 100644 --- a/qad_graphic/graphic.cpp +++ b/qad_graphic/graphic.cpp @@ -461,7 +461,7 @@ void Graphic::setHistorySize(double val) { double x; for (int i = 0; i < graphics.size(); ++i) { QPolygonF & pol(graphics[i].polyline); - if (pol.isEmpty()) continue; + if (pol.isEmpty() || history <= 0.) continue; x = pol.back().x() - history; for (int j = pol.size() - 2; j >= 0 ; --j) if (pol[j].x() < x) { @@ -1088,10 +1088,11 @@ void Graphic::tick(int index, bool slide, bool update_) { if (slide) { mutex.lock(); GraphicType & t(graphics[index]); - while (t.polyline.size() > 1) { - if (fabs(t.polyline.back().x() - t.polyline.front().x()) <= history) break; - t.polyline.pop_front(); - } + if (history > 0.) + while (t.polyline.size() > 1) { + if (fabs(t.polyline.back().x() - t.polyline.front().x()) <= history) break; + t.polyline.pop_front(); + } } if (!update_) { findGraphicsRect(); diff --git a/qad_graphic/graphic.h b/qad_graphic/graphic.h index 24a5f78..8e71eea 100644 --- a/qad_graphic/graphic.h +++ b/qad_graphic/graphic.h @@ -198,6 +198,7 @@ public: Graduation graduationY() const {return grad_y;} double graduationStepX() const {return gridx;} double graduationStepY() const {return gridy;} + QVector graphicData(const int index = 0) const {return graphics[index].polyline;} GraphicsData graphicsData() const; QWidget * viewport() const {return canvas;} QByteArray save(); diff --git a/qad_graphic/uglwidget.h b/qad_graphic/uglwidget.h index d6253fd..c3391eb 100644 --- a/qad_graphic/uglwidget.h +++ b/qad_graphic/uglwidget.h @@ -1,7 +1,7 @@ #ifndef UGLWIDGET_H #define UGLWIDGET_H -#include +#include #ifndef GL_MULTISAMPLE #define GL_MULTISAMPLE 0x809D #endif diff --git a/qad_graphic/uwidget.h b/qad_graphic/uwidget.h index 772242b..1d7f3bc 100644 --- a/qad_graphic/uwidget.h +++ b/qad_graphic/uwidget.h @@ -1,7 +1,7 @@ #ifndef UWIDGET_H #define UWIDGET_H -#include +#include #include #include #include