--- nono/wx/wxtextscreen.cpp 2026/04/29 17:05:44 1.1.1.13 +++ nono/wx/wxtextscreen.cpp 2026/04/29 17:05:57 1.1.1.15 @@ -10,7 +10,6 @@ #include "wxtextscreen.h" #include "fontmanager.h" -#include "wxcolor.h" #include "wxmainframe.h" #include "sjis.h" PRAGMA_PUSH_WARNINGS @@ -114,6 +113,8 @@ WXTextScreen::OnSize(wxSizeEvent& event) // テキストバッファを再構成しなくても全域を再描画する必要がある InvalidateText(); } + // サイズが変わったらどちらにしてもパディングも塗り直す。 + draw_padding = true; event.Skip(); } @@ -122,6 +123,13 @@ WXTextScreen::OnSize(wxSizeEvent& event) void WXTextScreen::Draw() { + if (__predict_false(draw_padding)) { + draw_padding = false; + auto bgcol = GetTextBackColor(); + // パディングを塗るだけでいいのだが手抜き。 + bitmap.Fill(bgcol); + } + auto text = screen.GetBuf().begin(); auto prev = prevbuf.begin(); @@ -209,7 +217,7 @@ WXTextScreen::Draw() int WXTextScreen::GetScreenWidth(int col_) const { - int w = GetFontWidth() * col_ + GetPaddingLeft() + GetPaddingRight(); + int w = GetFontWidth() * col_ + GetPaddingX(); return w; } @@ -217,7 +225,7 @@ WXTextScreen::GetScreenWidth(int col_) c int WXTextScreen::GetScreenHeight(int row_) const { - int h = GetFontHeight() * row_ + GetPaddingTop() + GetPaddingBottom(); + int h = GetFontHeight() * row_ + GetPaddingY(); return h; }