merge a few small 0.7 branch changes back into trunk

This commit is contained in:
Dane Springmeyer 2010-01-11 00:36:51 +00:00
parent 644843230d
commit f87790cd5b
5 changed files with 62 additions and 29 deletions

View file

@ -114,7 +114,8 @@ namespace mapnik {
unsigned width = in.width();
unsigned height = in.height();
unsigned alphaCount[alpha.size()];
//unsigned alphaCount[alpha.size()];
std::vector<unsigned> alphaCount(alpha.size());
for(unsigned i=0; i<alpha.size(); i++)
{
alpha[i] = 0;
@ -158,7 +159,8 @@ namespace mapnik {
unsigned width = in.width();
unsigned height = in.height();
unsigned alphaCount[alpha.size()];
//unsigned alphaCount[alpha.size()];
std::vector<unsigned> alphaCount(alpha.size());
for(unsigned i=0; i<alpha.size(); i++)
{
alpha[i] = 0;
@ -249,15 +251,16 @@ namespace mapnik {
// make transparent lowest indexes, so tRNS is small
if (alpha.size()>0)
{
png_byte trans[alpha.size()];
std::vector<png_byte> trans(alpha.size());
unsigned alphaSize=0;//truncate to nonopaque values
for(unsigned i=0; i<alpha.size(); i++){
for(unsigned i=0; i < alpha.size(); i++)
{
trans[i]=alpha[i];
if (alpha[i]<255)
alphaSize = i+1;
}
if (alphaSize>0)
png_set_tRNS(png_ptr, info_ptr, (png_bytep)trans, alphaSize, NULL);
png_set_tRNS(png_ptr, info_ptr, (png_bytep)&trans[0], alphaSize, 0);
}
png_write_info(png_ptr, info_ptr);

View file

@ -71,6 +71,21 @@ std::string numeric2string(const char* buf)
if (i <= weight && d < ndigits) {
// All digits after the first must be padded to make the field 4 characters long
if (d != 0) {
#ifdef _WINDOWS
int dig = digits[d];
if (dig < 10)
{
ss << "000"; // 0000 - 0009
}
else if (dig < 100)
{
ss << "00"; // 0010 - 0099
}
else
{
ss << "0"; // 0100 - 0999;
}
#else
switch(digits[d]) {
case 0 ... 9:
ss << "000"; // 0000 - 0009
@ -82,6 +97,7 @@ std::string numeric2string(const char* buf)
ss << "0"; // 0100 - 0999
break;
}
#endif
}
ss << digits[d++];
} else {

View file

@ -891,7 +891,18 @@ namespace mapnik
get_attr<label_placement_e>(sym, "placement", POINT_PLACEMENT);
text_symbol.set_label_placement( placement );
// vertical alignment
vertical_alignment_e valign = get_attr<vertical_alignment_e>(sym, "vertical_alignment", MIDDLE);
vertical_alignment_e default_vertical_alignment = MIDDLE;
if (dy > 0.0 )
{
default_vertical_alignment = BOTTOM;
}
else if( dy < 0.0 )
{
default_vertical_alignment = TOP;
}
vertical_alignment_e valign = get_attr<vertical_alignment_e>(sym, "vertical_alignment", default_vertical_alignment);
text_symbol.set_vertical_alignment(valign);
// halo fill and radius

View file

@ -0,0 +1,3 @@
<Map bgcolor="steelblue" minimum_version="50.0.0">
<!-- arbitrarily large version number that should throw error -->
</Map>