handle case of empty octrees. #540
This commit is contained in:
parent
8369278662
commit
3426e7a0ac
2 changed files with 7 additions and 2 deletions
|
@ -122,6 +122,11 @@ namespace mapnik {
|
|||
|
||||
~octree() { delete root_;}
|
||||
|
||||
unsigned colors()
|
||||
{
|
||||
return colors_;
|
||||
}
|
||||
|
||||
void setMaxColors(unsigned max_colors)
|
||||
{
|
||||
max_colors_ = max_colors;
|
||||
|
|
|
@ -131,7 +131,7 @@ namespace mapnik {
|
|||
byte index = 0;
|
||||
int idx = -1;
|
||||
for(int j=levels-1; j>0; j--){
|
||||
if (U2ALPHA(val)>=limits[j]) {
|
||||
if (U2ALPHA(val)>=limits[j] && trees[j].colors()>0) {
|
||||
index = idx = trees[j].quantize(c);
|
||||
break;
|
||||
}
|
||||
|
@ -177,7 +177,7 @@ namespace mapnik {
|
|||
byte index = 0;
|
||||
int idx=-1;
|
||||
for(int j=levels-1; j>0; j--){
|
||||
if (U2ALPHA(val)>=limits[j]) {
|
||||
if (U2ALPHA(val)>=limits[j] && trees[j].colors()>0) {
|
||||
index = idx = trees[j].quantize(c);
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue