svnno****@sourc*****
svnno****@sourc*****
2011年 8月 13日 (土) 22:15:24 JST
Revision: 4581 http://sourceforge.jp/projects/ttssh2/svn/view?view=rev&revision=4581 Author: maya Date: 2011-08-13 22:15:23 +0900 (Sat, 13 Aug 2011) Log Message: ----------- è¨å®å¤ã®èªèãééã£ã¦ããã®ã§ä¿®æ£ Modified Paths: -------------- trunk/teraterm/teraterm/vtdisp.c -------------- next part -------------- Modified: trunk/teraterm/teraterm/vtdisp.c =================================================================== --- trunk/teraterm/teraterm/vtdisp.c 2011-08-13 12:46:53 UTC (rev 4580) +++ trunk/teraterm/teraterm/vtdisp.c 2011-08-13 13:15:23 UTC (rev 4581) @@ -80,7 +80,7 @@ #define BG_SECTION "BG" typedef enum _BG_TYPE {BG_COLOR = 0,BG_PICTURE,BG_WALLPAPER} BG_TYPE; -typedef enum _BG_PATTERN {BG_STRETCH = 0,BG_TILE,BG_CENTER,BG_FIT_WIDTH,BG_FIT_HEIGHT,BG_AUTOFIT} BG_PATTERN; +typedef enum _BG_PATTERN {BG_STRETCH = 0,BG_TILE,BG_CENTER,BG_FIT_WIDTH,BG_FIT_HEIGHT,BG_AUTOFIT,BG_AUTOFILL} BG_PATTERN; typedef struct _BGSrc { @@ -627,17 +627,19 @@ if(tile) wi->pattern = BG_TILE; else - if(wi->pattern == 0) + if(wi->pattern == 0) // Center(É\¦) wi->pattern = BG_CENTER; else - if(wi->pattern == 2) + if(wi->pattern == 2) // Stretch(æÊÉí¹ÄLk) AXyNgäͳ³êé wi->pattern = BG_STRETCH; else - if(wi->pattern == 10) - wi->pattern = BG_FIT_HEIGHT; + if(wi->pattern == 10) // Fill(y[W¡Éí¹é) Æ éªAa󪨩µ¢ + // AXyNgäðÛµÄAÍÝoµÄÅàÅå\¦·é + wi->pattern = BG_AUTOFILL; else - if(wi->pattern == 6) - wi->pattern = BG_FIT_WIDTH; + if(wi->pattern == 6) // Fit(y[WcÉí¹é) Æ éªAa󪨩µ¢ + // AXyNgäðÛµÄAÍÝo³È¢æ¤ÉÅå\¦·é + wi->pattern = BG_AUTOFIT; //WXgL[ÌN[Y RegCloseKey(hKey); @@ -839,14 +841,34 @@ if (wi.pattern == BG_STRETCH) { s_width = CRTWidth; s_height = CRTHeight; - } else if (wi.pattern == BG_FIT_WIDTH) { - ratio = (float)CRTWidth / bm.bmWidth; - s_width = CRTWidth; - s_height = (int)(bm.bmHeight * ratio); - } else if (wi.pattern == BG_FIT_HEIGHT) { - ratio = (float)CRTHeight / bm.bmHeight; - s_width = (int)(bm.bmWidth * ratio); - s_height = CRTHeight; + } else if (wi.pattern == BG_AUTOFILL || wi.pattern == BG_AUTOFIT) { + if (wi.pattern == BG_AUTOFILL) { + if ((bm.bmHeight * CRTWidth) < (bm.bmWidth * CRTHeight)) { + wi.pattern = BG_FIT_HEIGHT; + } + else { + wi.pattern = BG_FIT_WIDTH; + } + } + if (wi.pattern == BG_AUTOFIT) { + if ((bm.bmHeight * CRTWidth) < (bm.bmWidth * CRTHeight)) { + wi.pattern = BG_FIT_WIDTH; + } + else { + wi.pattern = BG_FIT_HEIGHT; + } + } + if (wi.pattern == BG_FIT_WIDTH) { + ratio = (float)CRTWidth / bm.bmWidth; + s_width = CRTWidth; + s_height = (int)(bm.bmHeight * ratio); + } + else { + ratio = (float)CRTHeight / bm.bmHeight; + s_width = (int)(bm.bmWidth * ratio); + s_height = CRTHeight; + } + } else { s_width = 0; s_height = 0;