diff options
author | Merov Linden <merov@lindenlab.com> | 2013-01-04 20:28:01 -0800 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2013-01-04 20:28:01 -0800 |
commit | fbc414c02b80da1c0c5c1ebbbbcb84958938be6e (patch) | |
tree | 27a1ff7592fa9f9de9e0f3d228076c59174bdd41 /indra/llui/llview.cpp | |
parent | 12554bffb34895533ed11013a780bfa088756a67 (diff) | |
parent | 39ff545bab2c1e05b7b9fe14ee99828795f1f78f (diff) |
Merge with viewer-chui
Diffstat (limited to 'indra/llui/llview.cpp')
-rw-r--r-- | indra/llui/llview.cpp | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 5bcdae921d..3613a40e2c 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -55,6 +55,8 @@ #include "lltexteditor.h" #include "lltextbox.h" +static const S32 LINE_HEIGHT = 15; + S32 LLView::sDepth = 0; bool LLView::sDebugRects = false; bool LLView::sDebugRectsShowNames = true; @@ -1203,11 +1205,24 @@ void LLView::drawDebugRect() && preview_iter == sPreviewHighlightedElements.end() && sDebugRectsShowNames) { - //char temp[256]; S32 x, y; gGL.color4fv( border_color.mV ); - x = debug_rect.getWidth()/2; - y = debug_rect.getHeight()/2; + + x = debug_rect.getWidth() / 2; + + S32 rect_height = debug_rect.getHeight(); + S32 lines = rect_height / LINE_HEIGHT + 1; + + S32 depth = 0; + LLView * viewp = this; + while (NULL != viewp) + { + viewp = viewp->getParent(); + depth++; + } + + y = rect_height - LINE_HEIGHT * (depth % lines + 1); + std::string debug_text = llformat("%s (%d x %d)", getName().c_str(), debug_rect.getWidth(), debug_rect.getHeight()); LLFontGL::getFontSansSerifSmall()->renderUTF8(debug_text, 0, (F32)x, (F32)y, border_color, |