summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorrichard <none@none>2009-11-04 19:00:40 -0800
committerrichard <none@none>2009-11-04 19:00:40 -0800
commit723a86f608879d192347039570e37bd1c04752e1 (patch)
tree0e6a785793d7c84df47449fd1f2ace49e0114f87 /indra
parent83fb99a9ac2f07334233e7307cc18a4d340c8527 (diff)
fixed layout of items embedded in notecards
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llviewertexteditor.cpp21
1 files changed, 19 insertions, 2 deletions
diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp
index 75555efe7a..6f8818be6e 100644
--- a/indra/newview/llviewertexteditor.cpp
+++ b/indra/newview/llviewertexteditor.cpp
@@ -188,7 +188,24 @@ public:
/*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const
{
- return 1;
+ // always draw at beginning of line
+ if (line_offset == 0)
+ {
+ return 1;
+ }
+ else
+ {
+ S32 width, height;
+ getDimensions(mStart, 1, width, height);
+ if (width > num_pixels)
+ {
+ return 0;
+ }
+ else
+ {
+ return 1;
+ }
+ }
}
/*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect)
{
@@ -208,7 +225,7 @@ public:
}
F32 right_x;
- mStyle->getFont()->render(mLabel, 0, image_rect.mRight + EMBEDDED_ITEM_LABEL_PADDING, draw_rect.mBottom, color, LLFontGL::LEFT, LLFontGL::BOTTOM, LLFontGL::UNDERLINE, LLFontGL::NO_SHADOW, mLabel.length(), S32_MAX, &right_x);
+ mStyle->getFont()->render(mLabel, 0, image_rect.mRight + EMBEDDED_ITEM_LABEL_PADDING, draw_rect.mTop, color, LLFontGL::LEFT, LLFontGL::TOP, LLFontGL::UNDERLINE, LLFontGL::NO_SHADOW, mLabel.length(), S32_MAX, &right_x);
return right_x;
}