Changeset 3832

Show
Ignore:
Timestamp:
07/14/11 15:16:51 (10 months ago)
Author:
sbrunner
Message:

fix issue introduce with [3831] maine map will not be visible :(

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • print/trunk/src/main/java/org/mapfish/print/PDFUtils.java

    r3831 r3832  
    132132            } 
    133133            else { 
    134                 float maxw = w; 
    135                 float maxh = h; 
    136                 w = template.getWidth() * scale; 
    137                 h = template.getWidth() * scale; 
    138                 float scalew = w / maxw; 
    139                 float scaleh = h / maxh; 
    140                 float maxscale = Math.max(scalew, scaleh); 
    141                 if (maxscale > 1f) { 
    142                     w /=  maxscale; 
    143                     h /=  maxscale; 
     134                if (scale == 0f) { 
     135                    h = w / template.getWidth() * template.getHeight(); 
     136                } 
     137                else { 
     138                    float maxw = w; 
     139                    float maxh = h; 
     140                    w = template.getWidth() * scale; 
     141                    h = template.getWidth() * scale; 
     142                    float scalew = w / maxw; 
     143                    float scaleh = h / maxh; 
     144                    float maxscale = Math.max(scalew, scaleh); 
     145                    if (maxscale > 1f) { 
     146                        w /=  maxscale; 
     147                        h /=  maxscale; 
     148                    } 
    144149                } 
    145150            }