Fix limits calculation bug with copy_hline and and clear_box - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/canvas.h
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2012年08月08日 21:40:59 +0200
committerFrancesco Abbate <francesco.bbt@gmail.com>2012年08月08日 21:40:59 +0200
commit37791df9f7ab54333c95894df33114e4d5a02310 (patch)
treebdfc385debcf258de54dec4c83cf72638cbcc8de /agg-plot/canvas.h
parent5022c5f533bb1f0b5241de0c4cd33fb0ca3508d1 (diff)
downloadgsl-shell-37791df9f7ab54333c95894df33114e4d5a02310.tar.gz
Fix limits calculation bug with copy_hline and and clear_box
Diffstat (limited to 'agg-plot/canvas.h')
-rw-r--r--agg-plot/canvas.h 7
1 files changed, 3 insertions, 4 deletions
diff --git a/agg-plot/canvas.h b/agg-plot/canvas.h
index 3a35a501..c75417d2 100644
--- a/agg-plot/canvas.h
+++ b/agg-plot/canvas.h
@@ -44,9 +44,8 @@ public:
void clear_box(const agg::rect_base<int>& r)
{
- unsigned len = r.x2 - r.x1;
for (int y = r.y1; y < r.y2; y++)
- m_ren_base.copy_hline (r.x1, y, len, m_bgcol);
+ m_ren_base.copy_hline (r.x1, y, r.x2, m_bgcol);
}
void clip_box(const agg::rect_base<int>& clip)
@@ -95,9 +94,9 @@ public:
void clear_box(const agg::rect_base<int>& r)
{
- unsigned len = subpixel_scale * (r.x2 - r.x1);
+ int x1 = subpixel_scale * r.x1, x2 = subpixel_scale * r.x2;
for (int y = r.y1; y < r.y2; y++)
- m_ren_base.copy_hline (subpixel_scale * r.x1, y, len, m_bgcol);
+ m_ren_base.copy_hline (x1, y, x2, m_bgcol);
}
void clip_box(const agg::rect_base<int>& clip)
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月17日 04:09:52 +0000

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