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-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
parent9e38131c02023b7159d6220c7e4e354c14a70046 (diff)
downloadgsl-shell-f4b88da6e6c09ab3c20ac8e604eae0a376c235cc.tar.gz
fixed error in update box region calculation for animated plots
Diffstat (limited to 'agg-plot/window.cpp')
-rw-r--r--agg-plot/window.cpp 39
1 files changed, 24 insertions, 15 deletions
diff --git a/agg-plot/window.cpp b/agg-plot/window.cpp
index 51fe18d3..2a01999a 100644
--- a/agg-plot/window.cpp
+++ b/agg-plot/window.cpp
@@ -36,6 +36,17 @@ static const struct luaL_Reg window_methods[] = {
__END_DECLS
+struct dispose_buffer {
+ static void func (window::ref& ref)
+ {
+ if (ref.layer_buf)
+ {
+ delete [] ref.layer_buf;
+ ref.layer_buf = 0;
+ }
+ }
+};
+
agg::rect_base<int> rect_of_slot_matrix (const agg::trans_affine& mtx)
{
return agg::rect_base<int>(mtx.tx, mtx.ty, mtx.sx + mtx.tx, mtx.sy + mtx.ty);
@@ -163,7 +174,9 @@ void window::draw_slot_by_ref(window::ref& ref, bool update_req)
AGG_UNLOCK();
if (update_req)
- platform_support_update_region (this, r);
+ {
+ platform_support_update_region (this, r);
+ }
}
void
@@ -173,7 +186,10 @@ window::draw_slot(int slot_id, bool clean_req)
if (ref && m_canvas)
{
if (clean_req || ref->plot->need_redraw())
- draw_slot_by_ref(*ref, true);
+ {
+ draw_slot_by_ref(*ref, true);
+ dispose_buffer::func(*ref);
+ }
refresh_slot_by_ref(*ref);
}
@@ -209,6 +225,7 @@ window::restore_slot_image(int slot_id)
m_canvas->clear_box(r);
draw_slot_by_ref (*ref, false);
ref->save_image(this->rbuf_window(), r, this->bpp(), this->flip_y());
+ ref->dirty_rect.clear();
}
else
{
@@ -231,9 +248,12 @@ window::refresh_slot_by_ref(ref& ref)
if (ref.plot->draw_queue(*m_canvas, mtx, bb))
{
agg::rect_base<int> bbw(bb.x1 - 4, bb.y1 - 4, bb.x2 + 4, bb.y2 + 4);
- platform_support_update_region (this, bbw);
+ agg::rect_base<int> dbox;
+ ref.dirty_rect.compose(dbox, bbw);
+ platform_support_update_region (this, dbox);
+ ref.dirty_rect.set(bbw);
}
- }
+ }
catch (std::bad_alloc&) { }
AGG_UNLOCK();
}
@@ -248,17 +268,6 @@ window::on_draw()
draw_rec(m_tree);
}
-struct dispose_buffer {
- static void func (window::ref& ref)
- {
- if (ref.layer_buf)
- {
- delete [] ref.layer_buf;
- ref.layer_buf = 0;
- }
- }
-};
-
void
window::on_resize(int sx, int sy)
{
generated by cgit v1.2.3 (git 2.25.1) at 2025年09月13日 03:26:01 +0000

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