@@ -207,18 +207,37 @@ void CTextDrawer::DispVerticalLines(
207207 gr.SetPen ( cVertType.GetTextColor () );
208208 }
209209
210+ // 1半角文字に対応するレイアウト座標数(プロポーショナル版ではルーラー文字幅px)
211+ int nXDefault = (Int)pView->GetTextMetrics ().GetLayoutXDefault ();
212+ // レイアウト座標数に対応するpx数(プロポーショナル版では絶えず1)
213+ int px = pView->GetTextMetrics ().GetCharPxWidth ();
214+
215+ DispVerticalLinesImpl (gr, typeData.m_nVertLineIdx , MAX_VERTLINES, bBold, bDot,
216+ (Int)nViewLeftCol, (Int)nWrapLayout, (Int)nRightCol, nPosXOffset, nPosXLeft, nPosXRight, nTop, nBottom, 1 , bOddLine,
217+ nXDefault, px);
218+
219+ if ( bExorPen ){
220+ ::SetROP2 ( gr, nROP_Old );
221+ }
222+ }
223+
224+ void CTextDrawer::DispVerticalLinesImpl (HDC hdc, const int *nArrVertLineIdx, int nArrVertLineSize,
225+ bool bBold,bool bDot, int nViewLeftCol, int nWrapLayout, int nRightCol,
226+ int nPosXOffset, int nPosXLeft, int nPosXRight, int nTop, int nBottom, int nDirectY, bool bOddLine,
227+ int nLayoutXDefault, int nCharPx)
228+ {
210229 int k;
211- for ( k = 0 ; k < MAX_VERTLINES && typeData. m_nVertLineIdx [k] != 0 ; k++ ){
230+ for ( k = 0 ; k < nArrVertLineSize && nArrVertLineIdx [k] != 0 ; k++ ){
212231 // nXColは1開始。GetTextArea().GetViewLeftCol()は0開始なので注意。
213- CLayoutXInt nXCol = pView-> GetTextMetrics (). GetLayoutXDefault (typeData. m_nVertLineIdx [k]) ;
214- CLayoutXInt nXColEnd = nXCol;
215- CLayoutXInt nXColAdd = pView-> GetTextMetrics (). GetLayoutXDefault () ;
232+ int nXCol = nLayoutXDefault * nArrVertLineIdx [k];
233+ int nXColEnd = nXCol;
234+ int nXColAdd = nLayoutXDefault ;
216235 // nXColがマイナスだと繰り返し。k+1を終了値、k+2をステップ幅として利用する
217236 if ( nXCol < 0 ){
218- if ( k < MAX_VERTLINES - 2 ){
237+ if ( k < nArrVertLineSize - 2 ){
219238 nXCol = -nXCol;
220- nXColEnd = pView-> GetTextMetrics (). GetLayoutXDefault (typeData. m_nVertLineIdx [++k]) ;
221- nXColAdd = pView-> GetTextMetrics (). GetLayoutXDefault (typeData. m_nVertLineIdx [++k]) ;
239+ nXColEnd = nLayoutXDefault * nArrVertLineIdx [++k];
240+ nXColAdd = nLayoutXDefault * nArrVertLineIdx [++k];
222241 if ( nXColEnd < nXCol || nXColAdd <= 0 ){
223242 continue ;
224243 }
@@ -235,7 +254,7 @@ void CTextDrawer::DispVerticalLines(
235254 if ( nWrapLayout < nXCol ){
236255 break ;
237256 }
238- int nPosX = nPosXOffset + pView-> GetTextMetrics (). GetCharPxWidth ( nXCol - pView-> GetTextMetrics (). GetLayoutXDefault () - nViewLeftCol);
257+ int nPosX = nPosXOffset + nCharPx * ( nXCol - nLayoutXDefault - nViewLeftCol);
239258 // 2006.04.30 Moca 線の引く範囲・方法を変更
240259 // 太線の場合、半分だけ作画する可能性がある。
241260 int nPosXBold = nPosX;
@@ -253,32 +272,29 @@ void CTextDrawer::DispVerticalLines(
253272 if ( bOddLine ){
254273 y++;
255274 }
256- for ( ; y < nBottom; y += 2 ){
275+ for ( ; y < nBottom; y += nDirectY * 2 ){
257276 if ( nPosX < nPosXRight ){
258- ::MoveToEx ( gr , nPosX, y, NULL );
259- ::LineTo ( gr , nPosX, y + 1 );
277+ ::MoveToEx ( hdc , nPosX, y, NULL );
278+ ::LineTo ( hdc , nPosX, y + nDirectY );
260279 }
261280 if ( bBold && nPosXLeft <= nPosXBold ){
262- ::MoveToEx ( gr , nPosXBold, y, NULL );
263- ::LineTo ( gr , nPosXBold, y + 1 );
281+ ::MoveToEx ( hdc , nPosXBold, y, NULL );
282+ ::LineTo ( hdc , nPosXBold, y + nDirectY );
264283 }
265284 }
266285 }else {
267286 if ( nPosX < nPosXRight ){
268- ::MoveToEx ( gr , nPosX, nTop, NULL );
269- ::LineTo ( gr , nPosX, nBottom );
287+ ::MoveToEx ( hdc , nPosX, nTop, NULL );
288+ ::LineTo ( hdc , nPosX, nBottom );
270289 }
271290 if ( bBold && nPosXLeft <= nPosXBold ){
272- ::MoveToEx ( gr , nPosXBold, nTop, NULL );
273- ::LineTo ( gr , nPosXBold, nBottom );
291+ ::MoveToEx ( hdc , nPosXBold, nTop, NULL );
292+ ::LineTo ( hdc , nPosXBold, nBottom );
274293 }
275294 }
276295 }
277296 }
278297 }
279- if ( bExorPen ){
280- ::SetROP2 ( gr, nROP_Old );
281- }
282298}
283299
284300void CTextDrawer::DispNoteLine (
0 commit comments