Improve accuracy of textshape bounding box - gsl-shell.git - gsl-shell

index : gsl-shell.git
gsl-shell
summary refs log tree commit diff
path: root/agg-plot/text-shape.h
diff options
context:
space:
mode:
authorFrancesco Abbate <francesco.bbt@gmail.com>2012年01月28日 15:11:54 +0100
committerFrancesco Abbate <francesco.bbt@gmail.com>2012年01月30日 21:26:02 +0100
commit21c558ec9a0f0eae7287a5c7fc452b35b463321a (patch)
tree4a78ee1a896442e127e38f9000da8743129ed11a /agg-plot/text-shape.h
parent5e7376331cc7c1a2b238f6f960d9e512217186d5 (diff)
downloadgsl-shell-21c558ec9a0f0eae7287a5c7fc452b35b463321a.tar.gz
Improve accuracy of textshape bounding box
Diffstat (limited to 'agg-plot/text-shape.h')
-rw-r--r--agg-plot/text-shape.h 5
1 files changed, 5 insertions, 0 deletions
diff --git a/agg-plot/text-shape.h b/agg-plot/text-shape.h
index 326ca9b8..c09b749e 100644
--- a/agg-plot/text-shape.h
+++ b/agg-plot/text-shape.h
@@ -44,6 +44,11 @@ namespace draw {
virtual void bounding_box(double *x1, double *y1, double *x2, double *y2)
{
agg::bounding_rect_single(m_sg_text, 0, x1, y1, x2, y2);
+ const double pad = 1.0;
+ *x1 -= pad;
+ *y1 -= pad;
+ *x2 += pad;
+ *y2 += pad;
}
virtual str write_svg(int id, agg::rgba8 c, double h)
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月26日 19:42:53 +0000

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