diff options
author | Jochen Topf <jochen@topf.org> | 2011-10-13 10:24:30 +0200 |
---|---|---|
committer | Jochen Topf <jochen@topf.org> | 2011-10-13 10:24:30 +0200 |
commit | 13c3e0d2742b90eed09beb19e3622b795da9002b (patch) | |
tree | bae2df6729f7ed0266da8eef7ab40e62cc586729 /tagstats/geodistribution.hpp | |
parent | fc9dbd0508e37c0c7398c480d28a69f2a1c3e58a (diff) | |
download | taginfo-13c3e0d2742b90eed09beb19e3622b795da9002b.tar taginfo-13c3e0d2742b90eed09beb19e3622b795da9002b.tar.gz |
fix: distribution map did not work when there were no nodes with a tag
Diffstat (limited to 'tagstats/geodistribution.hpp')
-rw-r--r-- | tagstats/geodistribution.hpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tagstats/geodistribution.hpp b/tagstats/geodistribution.hpp index 8b4e43f..d4a080f 100644 --- a/tagstats/geodistribution.hpp +++ b/tagstats/geodistribution.hpp @@ -179,7 +179,7 @@ public: } } - void *png = gdImagePngPtr(im, size); + void* png = gdImagePngPtr(im, size); gdImageDestroy(im); return png; @@ -192,6 +192,17 @@ public: gdFree(png); } + static void* create_empty_png(int* size) { + gdImagePtr im = gdImageCreate(c_width, c_height); + int bgColor = gdImageColorAllocate(im, 0, 0, 0); + gdImageColorTransparent(im, bgColor); + + void* png = gdImagePngPtr(im, size); + gdImageDestroy(im); + + return png; + } + /** * Return the number of cells set. */ |