Skip to content
Snippets Groups Projects
Commit 723a86f6 authored by richard's avatar richard
Browse files

fixed layout of items embedded in notecards

parent 83fb99a9
No related branches found
No related tags found
No related merge requests found
...@@ -188,7 +188,24 @@ class LLEmbeddedItemSegment : public LLTextSegment ...@@ -188,7 +188,24 @@ class LLEmbeddedItemSegment : public LLTextSegment
/*virtual*/ S32 getNumChars(S32 num_pixels, S32 segment_offset, S32 line_offset, S32 max_chars) const /*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) /*virtual*/ F32 draw(S32 start, S32 end, S32 selection_start, S32 selection_end, const LLRect& draw_rect)
{ {
...@@ -208,7 +225,7 @@ class LLEmbeddedItemSegment : public LLTextSegment ...@@ -208,7 +225,7 @@ class LLEmbeddedItemSegment : public LLTextSegment
} }
F32 right_x; 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; return right_x;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment