window drawing code rationalisation - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/window.cpp
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2010年08月23日 23:11:38 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2010年08月23日 23:11:38 +0200
commitd73491e40e2121d5e7ecb189bb0d32ebf3c59b40 (patch)
tree205bc9c03131ea1de25067e81f26cc7f42517b5c /agg-plot/window.cpp
parentfa2caafa71b81c34fccce6d16ae99ed47cf6f09f (diff)
downloadgsl-shell-d73491e40e2121d5e7ecb189bb0d32ebf3c59b40.tar.gz
window drawing code rationalisation
Diffstat (limited to 'agg-plot/window.cpp')
-rw-r--r--agg-plot/window.cpp 40
1 files changed, 22 insertions, 18 deletions
diff --git a/agg-plot/window.cpp b/agg-plot/window.cpp
index 7099dd21..85fdab76 100644
--- a/agg-plot/window.cpp
+++ b/agg-plot/window.cpp
@@ -96,12 +96,7 @@ window::draw_rec(ref::node *n)
ref *ref = n->content();
if (ref)
{
- if (ref->plot)
- {
- agg::trans_affine mtx(ref->matrix);
- this->scale(mtx);
- ref->plot->draw(*m_canvas, mtx);
- }
+ draw_slot_by_ref (*ref, false);
}
}
@@ -125,6 +120,26 @@ window::ref* window::ref_lookup (ref::node *p, int slot_id)
return NULL;
}
+void window::draw_slot_by_ref(window::ref& ref, bool dirty)
+{
+ if (! ref.plot)
+ return;
+
+ agg::trans_affine mtx(ref.matrix);
+ this->scale(mtx);
+
+ if (dirty)
+ {
+ agg::rect_base<int> r = rect_of_slot_matrix(mtx);
+ m_canvas->clear_box(r);
+ ref.plot->draw(*m_canvas, mtx);
+ platform_support_update_region (this, r);
+ }
+ else
+ {
+ ref.plot->draw(*m_canvas, mtx);
+ }
+}
void
window::draw_slot(int slot_id, bool update_req)
@@ -132,16 +147,7 @@ window::draw_slot(int slot_id, bool update_req)
ref *ref = window::ref_lookup (this->m_tree, slot_id);
if (ref && m_canvas)
{
- agg::trans_affine mtx(ref->matrix);
- this->scale(mtx);
-
- agg::rect_base<int> r = rect_of_slot_matrix(mtx);
- m_canvas->clear_box(r);
-
- ref->plot->draw(*m_canvas, mtx);
-
- if (update_req)
- platform_support_update_region (this, r);
+ draw_slot_by_ref(*ref, update_req);
}
}
@@ -319,8 +325,6 @@ window_attach (lua_State *L)
plot->slot_id = slot_id;
win->draw_slot(slot_id, true);
- /* win->on_draw();
- win->update_window(); */
win->unlock();
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月26日 10:39:16 +0000

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