Modified nsTextControlFrame::Paint to correctly paint the contents of a

multi-line text area.
This commit is contained in:
kmcclusk%netscape.com 1999-02-01 23:09:06 +00:00
parent 0b542b62ed
commit ab7e565d59
2 changed files with 10 additions and 2 deletions

View File

@ -677,13 +677,17 @@ nsTextControlFrame::PaintTextControl(nsIPresContext& aPresContext,
while (1) {
nsString substr;
if (-1 == pos) {
// Single line, no carriage return.
text.Right(substr, text.Length()-oldPos);
aRenderingContext.DrawString(substr, x, y);
break;
}
text.Left(substr, pos);
// Strip off substr up to carriage return
text.Mid(substr, oldPos, ((pos - oldPos) - 1));
aRenderingContext.DrawString(substr, x, y);
y += textHeight;
// Advance to the next carriage return
pos++;
oldPos = pos;
pos = text.Find('\n', pos);

View File

@ -677,13 +677,17 @@ nsTextControlFrame::PaintTextControl(nsIPresContext& aPresContext,
while (1) {
nsString substr;
if (-1 == pos) {
// Single line, no carriage return.
text.Right(substr, text.Length()-oldPos);
aRenderingContext.DrawString(substr, x, y);
break;
}
text.Left(substr, pos);
// Strip off substr up to carriage return
text.Mid(substr, oldPos, ((pos - oldPos) - 1));
aRenderingContext.DrawString(substr, x, y);
y += textHeight;
// Advance to the next carriage return
pos++;
oldPos = pos;
pos = text.Find('\n', pos);