summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui')
-rw-r--r--indra/llui/lltextbase.cpp8
-rw-r--r--indra/llui/lluictrlfactory.cpp2
-rw-r--r--indra/llui/lluictrlfactory.h21
3 files changed, 29 insertions, 2 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 1f120a1483..6c983fd92e 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -1138,6 +1138,8 @@ void LLTextBase::reflow(S32 start_index)
line_height = llmax(line_height, segment_height);
remaining_pixels -= segment_width;
+ // getNumChars() and getDimensions() should return consistent results
+ llassert_always(remaining_pixels >= 0);
seg_offset += character_count;
S32 last_segment_char_on_line = segment->getStart() + seg_offset;
@@ -2464,6 +2466,12 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin
{
LLWString text = mEditor.getWText();
+ LLUIImagePtr image = mStyle->getImage();
+ if( image.notNull())
+ {
+ num_pixels -= image->getWidth();
+ }
+
// search for newline and if found, truncate there
S32 last_char = mStart + segment_offset;
for (; last_char != mEnd; ++last_char)
diff --git a/indra/llui/lluictrlfactory.cpp b/indra/llui/lluictrlfactory.cpp
index 5807654e43..53967e4963 100644
--- a/indra/llui/lluictrlfactory.cpp
+++ b/indra/llui/lluictrlfactory.cpp
@@ -452,4 +452,4 @@ dummy_widget_creator_func_t* LLUICtrlFactory::getDefaultWidgetFunc(const std::ty
const std::string* LLUICtrlFactory::getWidgetTag(const std::type_info* widget_type)
{
return LLWidgetNameRegistry::instance().getValue(widget_type);
-}
+} \ No newline at end of file
diff --git a/indra/llui/lluictrlfactory.h b/indra/llui/lluictrlfactory.h
index b785102426..60f5fe9e1c 100644
--- a/indra/llui/lluictrlfactory.h
+++ b/indra/llui/lluictrlfactory.h
@@ -311,9 +311,28 @@ fail:
params.from_xui = true;
- T* widget = createWidget<T>(params, parent);
+ if (!params.validateBlock())
+ {
+ llwarns << getInstance()->getCurFileName() << ": Invalid parameter block for " << typeid(T).name() << llendl;
+ }
+ T* widget;
+ {
+ LLFastTimer timer(FTM_WIDGET_CONSTRUCTION);
+ widget = new T(params);
+ }
+ {
+ LLFastTimer timer(FTM_INIT_FROM_PARAMS);
+ widget->initFromParams(params);
+ }
+
+ if (parent)
+ {
+ S32 tab_group = params.tab_group.isProvided() ? params.tab_group() : -1;
+ setCtrlParent(widget, parent, tab_group);
+ }
typedef typename T::child_registry_t registry_t;
+
createChildren(widget, node, registry_t::instance(), output_node);
if (widget && !widget->postBuild())