private void _FormatBreakTextDrawItem(int aItemNo, int aFmtLeft, int aFmtRight, ref int aDrawItemNo, ref POINT aPos, ref RECT vRect, ref int vRemainderWidth, ref bool vParaFirst) { HCCustomDrawItem vDrawItem = DrawItems[aDrawItemNo]; HCCustomItem vItemBK = Items[vDrawItem.ItemNo]; int vLen = vItemBK.Text.Length; CalcItemFormatHeigh(vItemBK); int vWidth = Style.TempCanvas.TextWidth(vItemBK.Text[vLen - 1]); // 分裂前 vDrawItem.CharLen = vDrawItem.CharLen - 1; vDrawItem.Rect.Right = vDrawItem.Rect.Right - vWidth; vRemainderWidth = aFmtRight - vDrawItem.Rect.Right; FinishLine(aItemNo, aDrawItemNo, vRemainderWidth); // 分裂后 aPos.X = aFmtLeft; aPos.Y = vDrawItem.Rect.Bottom; vRect.Left = aPos.X; vRect.Top = aPos.Y; vRect.Right = vRect.Left + vWidth; vRect.Bottom = vRect.Top + FItemFormatHeight; NewDrawItem(vDrawItem.ItemNo, vLen - 1, 1, vRect, false, true, ref aDrawItemNo); vParaFirst = false; aPos.X = vRect.Right; vRemainderWidth = aFmtRight - vRect.Right; // 放入最多后的剩余量 }
private void NewDrawItem(int aItemNo, int aCharOffs, int aCharLen, RECT aRect, bool aParaFirst, bool aLineFirst, ref int vLastDrawItemNo) { HCCustomDrawItem vDrawItem = new HCCustomDrawItem(); vDrawItem.ItemNo = aItemNo; vDrawItem.CharOffs = aCharOffs; vDrawItem.CharLen = aCharLen; vDrawItem.ParaFirst = aParaFirst; vDrawItem.LineFirst = aLineFirst; vDrawItem.Rect = aRect; vLastDrawItemNo++; DrawItems.Insert(vLastDrawItemNo, vDrawItem); if (aCharOffs == 1) { Items[aItemNo].FirstDItemNo = vLastDrawItemNo; } }