summaryrefslogtreecommitdiff
path: root/indra/llui/llview.cpp
diff options
context:
space:
mode:
authorDave Parks <none@none>2010-06-07 23:05:22 -0500
committerDave Parks <none@none>2010-06-07 23:05:22 -0500
commitf461ae214c8c998f5a0e3661696a30d27ad2814e (patch)
treee9430d423ee46fad6cb8319575d37ec925b88e99 /indra/llui/llview.cpp
parent84e619a6dc9e5a5967c4ce035ac530a4588f72a5 (diff)
parent48809cb3a9350a0357a0fc710140e2437f3e068e (diff)
Merge with render-pipeline
Diffstat (limited to 'indra/llui/llview.cpp')
-rw-r--r--indra/llui/llview.cpp58
1 files changed, 8 insertions, 50 deletions
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index 262ebf7c21..6d476ee390 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -107,8 +107,6 @@ LLView::Params::Params()
top_delta("top_delta", S32_MAX),
left_pad("left_pad"),
left_delta("left_delta", S32_MAX),
- center_horiz("center_horiz", false),
- center_vert("center_vert", false),
from_xui("from_xui", false),
user_resize("user_resize"),
auto_resize("auto_resize"),
@@ -2505,7 +2503,6 @@ void LLView::applyXUILayout(LLView::Params& p, LLView* parent)
p.layout = parent->getLayout();
}
-
if (parent)
{
LLRect parent_rect = parent->getLocalRect();
@@ -2513,60 +2510,21 @@ void LLView::applyXUILayout(LLView::Params& p, LLView* parent)
LLRect last_rect = parent->getLocalRect();
bool layout_topleft = (p.layout() == "topleft");
- if (layout_topleft)
- {
- //invert top to bottom
- if (p.rect.top.isProvided()) p.rect.top = parent_rect.getHeight() - p.rect.top;
- if (p.rect.bottom.isProvided()) p.rect.bottom = parent_rect.getHeight() - p.rect.bottom;
- }
// convert negative or centered coordinates to parent relative values
// Note: some of this logic matches the logic in TypedParam<LLRect>::setValueFromBlock()
+ if (p.rect.left.isProvided() && p.rect.left < 0) p.rect.left = p.rect.left + parent_rect.getWidth();
+ if (p.rect.right.isProvided() && p.rect.right < 0) p.rect.right = p.rect.right + parent_rect.getWidth();
+ if (p.rect.bottom.isProvided() && p.rect.bottom < 0) p.rect.bottom = p.rect.bottom + parent_rect.getHeight();
+ if (p.rect.top.isProvided() && p.rect.top < 0) p.rect.top = p.rect.top + parent_rect.getHeight();
- if (p.center_horiz)
- {
- if (p.rect.left.isProvided() && p.rect.right.isProvided())
- {
- S32 width = p.rect.right - p.rect.left;
- width = llmax(width, 0);
- S32 offset = parent_rect.getWidth()/2 - width/2;
- p.rect.left = p.rect.left + offset;
- p.rect.right = p.rect.right + offset;
- }
- else
- {
- p.rect.left = p.rect.left + parent_rect.getWidth()/2 - p.rect.width/2;
- p.rect.right.setProvided(false); // recalculate the right
- }
- }
- else
- {
- if (p.rect.left.isProvided() && p.rect.left < 0) p.rect.left = p.rect.left + parent_rect.getWidth();
- if (p.rect.right.isProvided() && p.rect.right < 0) p.rect.right = p.rect.right + parent_rect.getWidth();
- }
- if (p.center_vert)
- {
- if (p.rect.bottom.isProvided() && p.rect.top.isProvided())
- {
- S32 height = p.rect.top - p.rect.bottom;
- height = llmax(height, 0);
- S32 offset = parent_rect.getHeight()/2 - height/2;
- p.rect.bottom = p.rect.bottom + offset;
- p.rect.top = p.rect.top + offset;
- }
- else
- {
- p.rect.bottom = p.rect.bottom + parent_rect.getHeight()/2 - p.rect.height/2;
- p.rect.top.setProvided(false); // recalculate the top
- }
- }
- else
+ if (layout_topleft)
{
- if (p.rect.bottom.isProvided() && p.rect.bottom < 0) p.rect.bottom = p.rect.bottom + parent_rect.getHeight();
- if (p.rect.top.isProvided() && p.rect.top < 0) p.rect.top = p.rect.top + parent_rect.getHeight();
+ //invert top to bottom
+ if (p.rect.top.isProvided()) p.rect.top = parent_rect.getHeight() - p.rect.top;
+ if (p.rect.bottom.isProvided()) p.rect.bottom = parent_rect.getHeight() - p.rect.bottom;
}
-
// DEPRECATE: automatically fall back to height of MIN_WIDGET_HEIGHT pixels
if (!p.rect.height.isProvided() && !p.rect.top.isProvided() && p.rect.height == 0)
{