From 5921f2c14b57bbc4c5c327713a521e270b250f52 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 18 May 2010 16:26:18 -0700 Subject: EXT-7398 FIXED negative top/bottom coordinates do the wrong thing with topleft layout reviewed by Leyla --- indra/llui/llview.cpp | 58 +++++++-------------------------------------------- 1 file changed, 8 insertions(+), 50 deletions(-) (limited to 'indra/llui/llview.cpp') diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index e67f0ec3fc..c091686ffb 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"), @@ -2501,7 +2499,6 @@ void LLView::applyXUILayout(LLView::Params& p, LLView* parent) p.layout = parent->getLayout(); } - if (parent) { LLRect parent_rect = parent->getLocalRect(); @@ -2509,60 +2506,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::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) { -- cgit v1.2.3 From cb0589715265dc1568626fe238aac7417b44ef89 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Tue, 25 May 2010 14:17:11 +0300 Subject: EXT-6726 WIP Added handlers for most of Appearance SP context/gear menus. Reviewed by Mike Antipov and Nyx at https://codereview.productengine.com/secondlife/r/428/ --HG-- branch : product-engine --- indra/llui/llview.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/llui/llview.cpp') diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index c091686ffb..bd56da9121 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -1319,8 +1319,6 @@ void LLView::drawChildren() if (viewp->getVisible() && viewp->getRect().isValid()) { - // check for bad data - llassert_always(viewp->getVisible() == TRUE); // Only draw views that are within the root view localRectToScreen(viewp->getRect(),&screenRect); if ( rootRect.overlaps(screenRect) && LLUI::sDirtyRect.overlaps(screenRect)) -- cgit v1.2.3