author | Francesco Abbate <francesco.bbt@gmail.com> | 2012年11月01日 15:46:41 +0100 |
---|---|---|
committer | Francesco Abbate <francesco.bbt@gmail.com> | 2012年11月01日 15:46:41 +0100 |
commit | 2eb370ffbec7d188e7ca18d24bcc39d7a2e41ba3 (patch) | |
tree | 855a069341bcbdf6753c71969f2f492e1570306c /agg-plot/plot.h | |
parent | bd3fa1b3747591bfa315124d16398162be30c785 (diff) | |
download | gsl-shell-2eb370ffbec7d188e7ca18d24bcc39d7a2e41ba3.tar.gz |
-rw-r--r-- | agg-plot/plot.h | 15 |
diff --git a/agg-plot/plot.h b/agg-plot/plot.h index 0ab76a89..06d0d35a 100644 --- a/agg-plot/plot.h +++ b/agg-plot/plot.h @@ -466,6 +466,11 @@ protected: bool m_need_redraw; opt_rect<double> m_rect; + // keep trace of the region where changes happened since + // the last pushlayer or clear + opt_rect<double> m_changes_accu; + opt_rect<double> m_changes_pending; + bool m_use_units; units m_ux, m_uy; @@ -505,6 +510,7 @@ void plot<RM>::commit_pending_draw() { push_drawing_queue(); m_need_redraw = false; + m_changes_pending.clear(); } template <class RM> @@ -642,6 +648,13 @@ template <class Canvas> void plot<RM>::draw_queue(Canvas& _canvas, const agg::tr bb.add<rect_union>(ebb); } + m_changes_accu.add<rect_union>(bb); + + if (m_changes_pending.is_defined()) + { + bb.add<rect_union>(m_changes_pending); + } + canvas.reset_clipping(); } @@ -1114,6 +1127,8 @@ void plot<RM>::clear_current_layer() clear_drawing_queue(); layer_dispose_elements(current); current->clear(); + m_changes_pending = m_changes_accu; + m_changes_accu.clear(); } template <class RM> |