fixed error in update box region calculation for animated plots - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/window-cpp.h
diff options
context:
space:
mode:
authorfrancesco-ST <francesco.abbate@st.com>2010年09月16日 18:42:47 +0200
committerfrancesco-ST <francesco.abbate@st.com>2010年09月16日 18:42:47 +0200
commitf4b88da6e6c09ab3c20ac8e604eae0a376c235cc (patch)
tree34fcffe0d45d800ae6f0a75df5c54404c16a5cae /agg-plot/window-cpp.h
parent9e38131c02023b7159d6220c7e4e354c14a70046 (diff)
downloadgsl-shell-f4b88da6e6c09ab3c20ac8e604eae0a376c235cc.tar.gz
fixed error in update box region calculation for animated plots
Diffstat (limited to 'agg-plot/window-cpp.h')
-rw-r--r--agg-plot/window-cpp.h 24
1 files changed, 22 insertions, 2 deletions
diff --git a/agg-plot/window-cpp.h b/agg-plot/window-cpp.h
index 359520eb..5f636357 100644
--- a/agg-plot/window-cpp.h
+++ b/agg-plot/window-cpp.h
@@ -16,6 +16,25 @@ extern "C" {
#include "agg_trans_affine.h"
#include "split-parser.h"
+class opt_rect {
+ typedef agg::rect_base<int> rect_type;
+
+ bool m_defined;
+ rect_type m_rect;
+
+public:
+ opt_rect() : m_defined(false) {};
+
+ void clear() { m_defined = false; };
+ void set(const rect_type& r) { m_defined = true; m_rect = r; };
+ const rect_type& box() const { return m_rect; };
+
+ void compose(rect_type& dst, const rect_type& r)
+ {
+ dst = (m_defined ? agg::unite_rectangles(m_rect, r) : r);
+ };
+};
+
class window : public canvas_window {
public:
typedef plot<drawable, lua_management> plot_type;
@@ -33,8 +52,9 @@ public:
unsigned char *layer_buf;
agg::rendering_buffer layer_img;
- ref() : plot(0), matrix(), layer_buf(0) {};
- ref(plot_type *p) : plot(p), matrix(), layer_buf(0) {};
+ opt_rect dirty_rect;
+
+ ref(plot_type *p = 0) : plot(p), matrix(), layer_buf(0), dirty_rect() {};
~ref() { if (layer_buf) delete layer_buf; };
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月13日 03:28:08 +0000

AltStyle によって変換されたページ (->オリジナル) /