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:
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月17日 17:54:34 +0000

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