- Flags &= (~ (EFI_HII_OUT_FLAGS) EFI_HII_OUT_FLAG_WRAP);\r
- Flags |= EFI_HII_OUT_FLAG_CLIP_CLEAN_X;\r
+ LineWidth = RowInfo[RowIndex].LineWidth;\r
+ Index1 = RowInfo[RowIndex].EndIndex;\r
+ if (LineWidth + BltX > Image->Width) {\r
+ if (Index1 > RowInfo[RowIndex].StartIndex) {\r
+ //\r
+ // Don't draw the last char on this row. And, don't draw the second last char (AdvanceX - Width - OffsetX).\r
+ //\r
+ LineWidth -= (Cell[Index1].Width + Cell[Index1].OffsetX);\r
+ LineWidth -= (Cell[Index1 - 1].AdvanceX - Cell[Index1 - 1].Width - Cell[Index1 - 1].OffsetX);\r
+ RowInfo[RowIndex].EndIndex = Index1 - 1;\r
+ RowInfo[RowIndex].LineWidth = LineWidth;\r
+ } else {\r
+ //\r
+ // There is no enough column to draw any character, so set current line width to zero.\r
+ // And go to draw Next line if LineBreak is set.\r
+ //\r
+ RowInfo[RowIndex].LineWidth = 0;\r
+ goto NextLine;\r
+ }\r
+ }\r