diff --git a/sakura_core/view/CRuler.cpp b/sakura_core/view/CRuler.cpp index b0d80f9c06..73197a7712 100644 --- a/sakura_core/view/CRuler.cpp +++ b/sakura_core/view/CRuler.cpp @@ -184,7 +184,7 @@ void CRuler::DrawRulerBg(CGraphics& gr) // 目盛り線を1本ずつ描画するのではなく後述する PolyPolyline でまとめて描画を行う const int nWidth = (Int)(m_pEditView->GetTextArea().GetRightCol() - i); - const size_t nLinesToDraw = 1 + std::min((nWidth + 1 + 1 + oneColumn - 1) / oneColumn, nMaxLineKetas - keta + 1); + const size_t nLinesToDraw = 1 + std::min((nWidth + 1 + 1 + oneColumn - 1) / oneColumn, std::max(nMaxLineKetas - keta, 0) + 1); auto& apt = m_apt; auto& asz = m_asz; apt.resize(nLinesToDraw * 2); diff --git a/sakura_core/view/figures/CFigure_Comma.cpp b/sakura_core/view/figures/CFigure_Comma.cpp index 7ebe840653..fbde3db0c7 100644 --- a/sakura_core/view/figures/CFigure_Comma.cpp +++ b/sakura_core/view/figures/CFigure_Comma.cpp @@ -90,6 +90,14 @@ void CFigure_Comma::DispSpace(CGraphics& gr, DispPos* pDispPos, CEditView* pcVie if (szViewString.length() < nTabDispWidth) { szViewString.append(nTabDispWidth - szViewString.length(), L' '); } + const INT* lpDx; + if( szViewString.length() > 64 ) { + static std::vector anHankakuDx; //!< 半角用文字間隔配列 + anHankakuDx.resize(szViewString.length(), pMetrics->GetHankakuDx()); + lpDx = &anHankakuDx[0]; + }else { + lpDx = pMetrics->GetDxArray_AllHankaku(); + } ::ExtTextOut( gr, sPos.GetDrawPos().x, @@ -98,7 +106,7 @@ void CFigure_Comma::DispSpace(CGraphics& gr, DispPos* pDispPos, CEditView* pcVie &rcClip2, szViewString.c_str(), static_cast(szViewString.length()), - pMetrics->GetDxArray_AllHankaku() + lpDx ); } }