[Ttssh2-commit] [4581] 設定値の認識が間違っていたので修正

Back to archive index

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(‰æ–ʂɍ‡‚킹‚ĐLk) ƒAƒXƒyƒNƒg”ä‚Í–³Ž‹‚³‚ê‚é
     wi->pattern = BG_STRETCH;
   else
-  if(wi->pattern == 10)
-	  wi->pattern = BG_FIT_HEIGHT;
+  if(wi->pattern == 10) // Fill(ƒy[ƒW‰¡•‚ɍ‡‚킹‚é) ‚Æ‚ ‚邪A˜a–󂪂¨‚©‚µ‚¢
+                        // ƒAƒXƒyƒNƒg”ä‚ðˆÛŽ‚µ‚āA‚͂ݏo‚µ‚Ä‚Å‚àÅ‘å•\Ž¦‚·‚é
+    wi->pattern = BG_AUTOFILL;
   else
-  if(wi->pattern == 6)
-	  wi->pattern = BG_FIT_WIDTH;
+  if(wi->pattern == 6) // Fit(ƒy[ƒWc•‚ɍ‡‚킹‚é) ‚Æ‚ ‚邪A˜a–󂪂¨‚©‚µ‚¢
+                       // ƒAƒXƒyƒNƒg”ä‚ðˆÛŽ‚µ‚āA‚͂ݏo‚³‚È‚¢‚悤‚ɍőå•\Ž¦‚·‚é
+    wi->pattern = BG_AUTOFIT;
 
   //ƒŒƒWƒXƒgƒŠƒL[‚̃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;



Ttssh2-commit メーリングリストの案内
Back to archive index