/[classpath]/classpath/gnu/java/awt/peer/gtk/GtkImage.java
ViewVC logotype

Diff of /classpath/gnu/java/awt/peer/gtk/GtkImage.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16 by smarothy, Sun Jun 5 23:48:54 2005 UTC revision 1.17 by smarothy, Thu Jun 23 20:35:49 2005 UTC
# Line 375  public class GtkImage extends Image Line 375  public class GtkImage extends Image
375      int dstY = (dy1 < dy2) ? dy1 : dy2;      int dstY = (dy1 < dy2) ? dy1 : dy2;
376    
377      // Clipping. This requires the dst to be scaled as well,      // Clipping. This requires the dst to be scaled as well,
378        if (srcWidth > width)
379          {
380            dstWidth = (int)((double)dstWidth*((double)width/(double)srcWidth));
381            srcWidth = width - srcX;
382          }
383    
384        if (srcHeight > height)
385          {
386            dstHeight = (int)((double)dstHeight*((double)height/(double)srcHeight));
387            srcHeight = height - srcY;
388          }
389    
390      if (srcWidth + srcX > width)      if (srcWidth + srcX > width)
391        {        {
392          dstWidth = (int)((double)dstWidth * (double)(width - srcX)/(double)srcWidth);          dstWidth = (int)((double)dstWidth * (double)(width - srcX)/(double)srcWidth);
393          srcWidth = width - srcX;          srcWidth = width - srcX;
394      }        }
395    
396      if (srcHeight + srcY > height)      if (srcHeight + srcY > height)
397        {        {
398          dstHeight = (int)((double)dstHeight * (double)(width - srcY)/(double)srcHeight);          dstHeight = (int)((double)dstHeight * (double)(width - srcY)/(double)srcHeight);
399          srcHeight = height - srcY;          srcHeight = height - srcY;
400        }        }
401        
402      if(bgcolor != null)      if(bgcolor != null)
403        drawPixelsScaledFlipped (g, bgcolor.getRed (), bgcolor.getGreen (),        drawPixelsScaledFlipped (g, bgcolor.getRed (), bgcolor.getGreen (),
404                                 bgcolor.getBlue (),                                 bgcolor.getBlue (),

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26