• R/O
  • SSH
  • HTTPS

ttssh2: Commit


Commit MetaInfo

Revision10286 (tree)
Time2022-09-24 23:19:40
Authorzmatsuo

Log Message

DECSCNM有効時のBCE動作がおかしい問題を修正

- BCE = Back Color Erase: 消去部分に背景色を適用
- DECSCNM有効時、背景色の入れ替えを行っていなかった
- r10269からおかしくなっていたので修正

Change Summary

Incremental Difference

--- branches/4-stable/teraterm/teraterm/vtdisp.c (revision 10285)
+++ branches/4-stable/teraterm/teraterm/vtdisp.c (revision 10286)
@@ -3701,22 +3701,30 @@
37013701 UpdateBGBrush();
37023702 }
37033703
3704-void UpdateBGBrush() {
3705- if (Background != NULL) DeleteObject(Background);
3704+static void UpdateBGBrush(void)
3705+{
3706+ if (Background != NULL) DeleteObject(Background);
37063707
3707- if ((CurCharAttr.Attr2 & Attr2Back) != 0) {
3708- if ((CurCharAttr.Back<16) && (CurCharAttr.Back&7)!=0)
3709- Background = CreateSolidBrush(ANSIColor[CurCharAttr.Back ^ 8]);
3710- else
3711- Background = CreateSolidBrush(ANSIColor[CurCharAttr.Back]);
3712- }
3713- else {
3714-#ifdef ALPHABLEND_TYPE2
3715- Background = CreateSolidBrush(BGVTColor[1]);
3716-#else
3717- Background = CreateSolidBrush(ts.VTColor[1]);
3718-#endif // ALPHABLEND_TYPE2
3719- }
3708+ if ((ts.ColorFlag & CF_REVERSEVIDEO) == 0) {
3709+ if ((CurCharAttr.Attr2 & Attr2Back) != 0) {
3710+ const WORD AttrFlag = ((ts.ColorFlag & CF_BLINKCOLOR) && (CurCharAttr.Attr & AttrBlink)) ? AttrBlink : 0;
3711+ const int index = Get256ColorIndex(CurCharAttr.Back, ts.ColorFlag & CF_PCBOLD16, AttrFlag & AttrBlink);
3712+ Background = CreateSolidBrush(ANSIColor[index]);
3713+ }
3714+ else {
3715+ Background = CreateSolidBrush(BGVTColor[1]);
3716+ }
3717+ }
3718+ else {
3719+ if ((CurCharAttr.Attr2 & Attr2Fore) != 0) {
3720+ const WORD AttrFlag = ((ts.ColorFlag & CF_BOLDCOLOR) && (CurCharAttr.Attr & AttrBold)) ? AttrBold : 0;
3721+ const int index = Get256ColorIndex(CurCharAttr.Fore, ts.ColorFlag & CF_PCBOLD16, AttrFlag & AttrBold);
3722+ Background = CreateSolidBrush(ANSIColor[index]);
3723+ }
3724+ else {
3725+ Background = CreateSolidBrush(BGVTColor[0]);
3726+ }
3727+ }
37203728 }
37213729
37223730 void DispShowWindow(int mode)
Show on old repository browser