Skip to content

Commit

Permalink
印刷で指定桁縦線を先(下)に引く
Browse files Browse the repository at this point in the history
  • Loading branch information
usagisita committed Apr 4, 2021
1 parent 6799f5d commit 326e625
Showing 1 changed file with 35 additions and 33 deletions.
68 changes: 35 additions & 33 deletions sakura_core/print/CPrintPreview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1468,6 +1468,41 @@ CColorStrategy* CPrintPreview::DrawPageText(
const int nBasePosX = nOffX + nDanWidth * nDan + nLineNumWidth * (nDan + 1);

const int charWidth = m_pPrintSetting->m_nPrintFontWidth;

// 指定桁縦線。段ごとに一度に引く
// 文字より下に描画、先に線を引いておく、背景色は透明に限る
if(m_typePrint.m_ColorInfoArr[COLORIDX_VERTLINE].m_bDisp){
const STypeConfig& type = m_typePrint;
const ColorInfo& vline_cinfo = type.m_ColorInfoArr[COLORIDX_VERTLINE];
const SColorAttr& vline_color = vline_cinfo.m_sColorAttr;
const SFontAttr& vline_attr = vline_cinfo.m_sFontAttr;
COLORREF pen_color = RGB(0,0,0);
if(m_pPrintSetting->m_bColorPrint){
pen_color = vline_color.m_cTEXT;
}
HPEN hpNew = ::CreatePen(PS_SOLID, vline_attr.m_bBoldFont ? 2 : 1, pen_color);
HPEN hpOld = (HPEN)::SelectObject(hdc, hpNew);
CTextDrawer::DispVerticalLinesImpl(
hdc, type.m_nVertLineIdx, MAX_VERTLINES,
false, // BoldはPen幅で対応
vline_attr.m_bUnderLine,
0, // nViewLeftCol 横スクロースしないので0固定
m_pPrintSetting->m_nPrintFontWidth * type.m_nMaxLineKetas, // nWrapLayout
nBasePosX + m_pPrintSetting->m_nPrintFontWidth * type.m_nMaxLineKetas, // nRightCol
nBasePosX, // nPosXOffset
nBasePosX, // nPosXLeft
nBasePosX + m_pPrintSetting->m_nPrintFontWidth * type.m_nMaxLineKetas, // nPosXRight
nDirectY * nOffY, // nTop,
nDirectY * (nOffY + nLineHeight * m_bPreview_EnableLines), // nBottom
nDirectY,
false, // bOddLine
m_pPrintSetting->m_nPrintFontWidth, // nLayoutXDefault
1 // nCharPx(プロポーショナル版では1固定)
);
::SelectObject(hdc, hpOld);
::DeleteObject(hpNew);
}

for( i = 0; i < m_bPreview_EnableLines; ++i ){
if( NULL != pCDlgCancel ){
/* 処理中のユーザー操作を可能にする */
Expand Down Expand Up @@ -1581,39 +1616,6 @@ CColorStrategy* CPrintPreview::DrawPageText(
nDirectY * ( nOffY + nLineHeight * i )
);
}

// 指定桁縦線。段ごとに一度に引く
const STypeConfig& type = m_typePrint;
const ColorInfo& vline_cinfo = type.m_ColorInfoArr[COLORIDX_VERTLINE];
const SColorAttr& vline_color = vline_cinfo.m_sColorAttr;
const SFontAttr& vline_attr = vline_cinfo.m_sFontAttr;
if(vline_cinfo.m_bDisp){
COLORREF pen_color = RGB(0,0,0);
if(m_pPrintSetting->m_bColorPrint){
pen_color = vline_color.m_cTEXT;
}
HPEN hpNew = ::CreatePen(PS_SOLID, vline_attr.m_bBoldFont ? 2 : 1, pen_color);
HPEN hpOld = (HPEN)::SelectObject(hdc, hpNew);
CTextDrawer::DispVerticalLinesImpl(
hdc, type.m_nVertLineIdx, MAX_VERTLINES,
false, // BoldはPen幅で対応
vline_attr.m_bUnderLine,
0, // nViewLeftCol 横スクロースしないので0固定
m_pPrintSetting->m_nPrintFontWidth * type.m_nMaxLineKetas, // nWrapLayout
nBasePosX + m_pPrintSetting->m_nPrintFontWidth * type.m_nMaxLineKetas, // nRightCol
nBasePosX, // nPosXOffset
nBasePosX, // nPosXLeft
nBasePosX + m_pPrintSetting->m_nPrintFontWidth * type.m_nMaxLineKetas, // nPosXRight
nDirectY * nOffY, // nTop,
nDirectY * ( nOffY + nLineHeight * i ), // nBottom
nDirectY,
false, // bOddLine
m_pPrintSetting->m_nPrintFontWidth, // nLayoutXDefault
1 // nCharPx(プロポーショナル版では1固定)
);
::SelectObject(hdc, hpOld);
::DeleteObject(hpNew);
}
}
return pStrategy;
}
Expand Down

0 comments on commit 326e625

Please sign in to comment.