変愚蛮怒のメインリポジトリです
Révision | eb729acf39977af9304369b0c153e8acc0ef0315 (tree) |
---|---|
l'heure | 2016-11-23 23:52:19 |
Auteur | Deskull <desull@user...> |
Commiter | Deskull |
拡大縮小処理のためにterm_change_tile_size()を実装。 / Implementing term_change_tile_size() for scaling.
@@ -1061,6 +1061,33 @@ static void term_getsize(term_data *td) | ||
1061 | 1061 | td->pos_y = rc.top; |
1062 | 1062 | } |
1063 | 1063 | |
1064 | +/* | |
1065 | + * Change tile size with keeping window size | |
1066 | + */ | |
1067 | +static void term_change_tile_size(term_data *td) | |
1068 | +{ | |
1069 | + RECT rc; | |
1070 | + | |
1071 | + int wid, hgt; | |
1072 | + | |
1073 | + /* Paranoia */ | |
1074 | + if (td->cols < 1) td->cols = 1; | |
1075 | + if (td->rows < 1) td->rows = 1; | |
1076 | + | |
1077 | + /* Adjust */ | |
1078 | + AdjustWindowRectEx(&rc, td->dwStyle, TRUE, td->dwExStyle); | |
1079 | + | |
1080 | + /* See CreateWindowEx */ | |
1081 | + if (!td->w) return; | |
1082 | + | |
1083 | + /* Extract actual location */ | |
1084 | + GetWindowRect(td->w, &rc); | |
1085 | + | |
1086 | + /* Save the location */ | |
1087 | + td->pos_x = rc.left; | |
1088 | + td->pos_y = rc.top; | |
1089 | +} | |
1090 | + | |
1064 | 1091 | |
1065 | 1092 | /* |
1066 | 1093 | * Write the "prefs" for a single term |
@@ -5939,7 +5966,7 @@ static void tile_zoom_in() | ||
5939 | 5966 | { |
5940 | 5967 | td->tile_hgt += 2; |
5941 | 5968 | td->tile_wid += 1; |
5942 | - term_getsize(td); | |
5969 | + term_change_tile_size(td); | |
5943 | 5970 | term_window_resize(td); |
5944 | 5971 | } |
5945 | 5972 | } |
@@ -5951,7 +5978,7 @@ static void tile_zoom_out() | ||
5951 | 5978 | { |
5952 | 5979 | td->tile_hgt -= 2; |
5953 | 5980 | td->tile_wid -= 1; |
5954 | - term_getsize(td); | |
5981 | + term_change_tile_size(td); | |
5955 | 5982 | term_window_resize(td); |
5956 | 5983 | } |
5957 | 5984 | } |
\ No newline at end of file |