gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/plot.h
diff options
context:
space:
mode:
Diffstat (limited to 'agg-plot/plot.h')
-rw-r--r--agg-plot/plot.h 20
1 files changed, 14 insertions, 6 deletions
diff --git a/agg-plot/plot.h b/agg-plot/plot.h
index 6550de74..1ef8bd0e 100644
--- a/agg-plot/plot.h
+++ b/agg-plot/plot.h
@@ -70,7 +70,7 @@ public:
plot(bool use_units = true) :
m_root_layer(), m_layers(), m_current_layer(&m_root_layer),
- m_drawing_queue(0),
+ m_drawing_queue(0), m_clip_flag(true),
m_need_redraw(true), m_rect(),
m_use_units(use_units), m_pad_units(false), m_title_buf(),
m_sync_mode(true)
@@ -115,6 +115,9 @@ public:
void clear_current_layer();
int current_layer_index();
+ bool clip_is_active() const { return m_clip_flag; };
+ void set_clip_mode(bool flag) { m_clip_flag = flag; };
+
bool need_redraw() const { return m_need_redraw; };
void commit_pending_draw();
@@ -162,6 +165,8 @@ protected:
agg::trans_affine m_trans;
pod_list<item> *m_drawing_queue;
+ bool m_clip_flag;
+
bool m_need_redraw;
opt_rect<double> m_rect;
@@ -306,11 +311,14 @@ agg::trans_affine plot<VS,RM>::get_scaled_matrix(agg::trans_affine& canvas_mtx)
template<class VS, class RM>
void plot<VS,RM>::clip_plot_area(canvas &canvas, agg::trans_affine& canvas_mtx)
{
- agg::trans_affine mvp;
- viewport_scale(mvp);
- trans_affine_compose (mvp, canvas_mtx);
- agg::rect_base<int> clip = rect_of_slot_matrix<int>(mvp);
- canvas.clip_box(clip);
+ if (this->clip_is_active())
+ {
+ agg::trans_affine mvp;
+ viewport_scale(mvp);
+ trans_affine_compose (mvp, canvas_mtx);
+ agg::rect_base<int> clip = rect_of_slot_matrix<int>(mvp);
+ canvas.clip_box(clip);
+ }
}
template<class VS, class RM>
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月14日 13:03:06 +0000

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