From 95fc42c3219151d085f139a8f239bdc5fb6b30f3 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 19 Jan 2010 15:19:11 -0500 Subject: Ensure Lynx's Boost patch is in place -- Windows --- install.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.xml b/install.xml index 5069e44d46..5cb960c506 100644 --- a/install.xml +++ b/install.xml @@ -214,9 +214,9 @@ windows md5sum - 6746ae9fd9aff98b15f7b9f0f40334ab + acbf7a4165a917a4e087879d1756b355 url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/boost-1.39.0-windows-20091204.tar.bz2 + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/boost-1.39.0-windows-20100119.tar.bz2 -- cgit v1.2.3 From dab8a89df68fe29ce3794d7763e9890da5ff7ed2 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 19 Jan 2010 12:23:25 -0800 Subject: Ensure Lynx's Boost patch is in place -- linux, linux64 --- install.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/install.xml b/install.xml index fdd7458384..e94654e175 100644 --- a/install.xml +++ b/install.xml @@ -200,16 +200,16 @@ linux md5sum - 7085044567999489d82b9ed28f16e480 + ee8e1b4bbcf137a84d6a85a1c51386ff url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/boost-1.39.0-linux-20091202.tar.bz2 + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/boost-1.39.0-linux-20100119.tar.bz2 linux64 md5sum - b4aeefcba3d749f1e9f2a12c6f70192b + af4badd6b2c10bc4db82ff1256695892 url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/boost-1.39.0-linux64-20091202.tar.bz2 + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/boost-1.39.0-linux64-20100119.tar.bz2 windows -- cgit v1.2.3 From 56c021f606d249e4b7ba334809b0332fe2fdcc11 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 19 Jan 2010 15:28:10 -0500 Subject: Ensure Lynx's Boost patch is in place -- darwin --- install.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.xml b/install.xml index fdd7458384..e08676d869 100644 --- a/install.xml +++ b/install.xml @@ -193,9 +193,9 @@ darwin md5sum - 609c469ee1857723260b5a9943b9c2c1 + 84821102cb819257a66c8f38732647fc url - http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/boost-1.39.0-darwin-20091202.tar.bz2 + http://s3.amazonaws.com/viewer-source-downloads/install_pkgs/boost-1.39.0-darwin-20100119.tar.bz2 linux -- cgit v1.2.3 From 6294d4f7bf809de91c910ff56391bcf9fa78b124 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Mon, 1 Feb 2010 15:24:38 -0800 Subject: Use "standard" llsd::equals --- indra/llprimitive/tests/llmediaentry_test.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/indra/llprimitive/tests/llmediaentry_test.cpp b/indra/llprimitive/tests/llmediaentry_test.cpp index 277e370ca4..88cd96ebe4 100644 --- a/indra/llprimitive/tests/llmediaentry_test.cpp +++ b/indra/llprimitive/tests/llmediaentry_test.cpp @@ -157,14 +157,9 @@ namespace namespace tut { - bool llsd_equals(const LLSD& a, const LLSD& b) { - // cheesy, brute force, but it works - return std::string(ll_pretty_print_sd(a)) == std::string(ll_pretty_print_sd(b)); - } - void ensure_llsd_equals(const std::string& msg, const LLSD& expected, const LLSD& actual) { - if (!tut::llsd_equals(expected, actual)) + if (!llsd_equals(expected, actual)) { std::string message = msg; message += ": actual: "; -- cgit v1.2.3 From 84e985e255b66e9ffb09deba373136c97eeb86b3 Mon Sep 17 00:00:00 2001 From: Erica Date: Mon, 1 Feb 2010 17:24:03 -0800 Subject: Preferences clean up in advance of qa beta branch --- .../default/xui/en/panel_preferences_advanced.xml | 307 ++++++++++----------- .../default/xui/en/panel_preferences_alerts.xml | 46 ++- .../default/xui/en/panel_preferences_general.xml | 24 +- .../default/xui/en/panel_preferences_sound.xml | 109 ++++---- 4 files changed, 229 insertions(+), 257 deletions(-) diff --git a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml index 141678f7eb..4d14d46743 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_advanced.xml @@ -1,9 +1,9 @@ - [NUM]:[DEN] - - - - - - - - Aspect ratio - - - - - - - - - - - -Camera: - + -Automatic positioning for: +Automatic position for: - -Avatars: - + + width="256" /> + + + + + + + width="256" /> + top_pad="5" + width="200" /> + + Aspect ratio + + + + + + + + + + diff --git a/indra/newview/skins/default/xui/en/panel_preferences_alerts.xml b/indra/newview/skins/default/xui/en/panel_preferences_alerts.xml index ace8281b4e..188fd3b7bc 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_alerts.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_alerts.xml @@ -1,7 +1,7 @@ @@ -32,7 +32,7 @@ - Always show these notifications: + Always show: @@ -81,17 +76,13 @@ enabled_control="FirstSelectedEnabledPopups" follows="top|left" height="23" - image_disabled="PushButton_Disabled" - image_disabled_selected="PushButton_Disabled" image_overlay="Arrow_Down" - image_selected="PushButton_Selected" - image_unselected="PushButton_Off" hover_glow_amount="0.15" layout="topleft" - left_pad="50" + left_pad="40" name="disable_this_popup" top_delta="0" - width="43"> + width="40"> @@ -99,21 +90,20 @@ type="string" length="1" follows="top|left" - font="SansSerifBold" height="12" layout="topleft" - left="30" + left="10" name="dont_show_label" - top_pad="10" + top_pad="-10" width="450"> - Never show these notifications: + Never show: diff --git a/indra/newview/skins/default/xui/en/panel_preferences_general.xml b/indra/newview/skins/default/xui/en/panel_preferences_general.xml index 22c75a595e..099c789e4b 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_general.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_general.xml @@ -89,11 +89,12 @@ (Requires restart) @@ -179,7 +180,7 @@ left_pad="5" name="show_location_checkbox" top_delta="5" - width="256" /> + width="256" /> + width="75" /> + width="75" /> + value="2" + width="160" /> Busy mode response: @@ -336,18 +336,16 @@ text_readonly_color="LabelDisabledColor" bg_writeable_color="LtGray" use_ellipses="false" - bg_visible="true" - border_visible="true" hover="false" commit_on_focus_lost = "true" follows="left|top" - height="50" + height="60" layout="topleft" left="50" name="busy_response" - width="400" + width="440" word_wrap="true"> log_in_to_change - + diff --git a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml index c01a032209..8bff865eb1 100644 --- a/indra/newview/skins/default/xui/en/panel_preferences_sound.xml +++ b/indra/newview/skins/default/xui/en/panel_preferences_sound.xml @@ -33,16 +33,15 @@ - - Aspect ratio - - - - - - - - - - -- cgit v1.2.3 From e918089f592da2094e6b23a146e0e30b711562dc Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Thu, 4 Feb 2010 17:04:27 +0200 Subject: Fixed critical bug (EXT-4827) [NUX] The Places Panel should default to the Landmarks tab with the Library expanded. - Added Library tab set open by default with Landmarks category fetch from Library. --HG-- branch : product-engine --- indra/newview/llpanellandmarks.cpp | 22 ++++++++++++++-------- indra/newview/llpanellandmarks.h | 2 +- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/indra/newview/llpanellandmarks.cpp b/indra/newview/llpanellandmarks.cpp index 47feef496a..7c1b0f6234 100644 --- a/indra/newview/llpanellandmarks.cpp +++ b/indra/newview/llpanellandmarks.cpp @@ -171,8 +171,6 @@ BOOL LLLandmarksPanel::postBuild() initLandmarksInventoryPanel(); initMyInventoryPanel(); initLibraryInventoryPanel(); - getChild("tab_favorites")->setDisplayChildren(true); - getChild("tab_landmarks")->setDisplayChildren(true); return TRUE; } @@ -462,7 +460,7 @@ void LLLandmarksPanel::initFavoritesInventoryPanel() initLandmarksPanel(mFavoritesInventoryPanel); mFavoritesInventoryPanel->getFilter()->setEmptyLookupMessage("FavoritesNoMatchingItems"); - initAccordion("tab_favorites", mFavoritesInventoryPanel); + initAccordion("tab_favorites", mFavoritesInventoryPanel, true); } void LLLandmarksPanel::initLandmarksInventoryPanel() @@ -481,7 +479,7 @@ void LLLandmarksPanel::initLandmarksInventoryPanel() // subscribe to have auto-rename functionality while creating New Folder mLandmarksInventoryPanel->setSelectCallback(boost::bind(&LLInventoryPanel::onSelectionChange, mLandmarksInventoryPanel, _1, _2)); - initAccordion("tab_landmarks", mLandmarksInventoryPanel); + initAccordion("tab_landmarks", mLandmarksInventoryPanel, true); } void LLLandmarksPanel::initMyInventoryPanel() @@ -490,7 +488,7 @@ void LLLandmarksPanel::initMyInventoryPanel() initLandmarksPanel(mMyInventoryPanel); - initAccordion("tab_inventory", mMyInventoryPanel); + initAccordion("tab_inventory", mMyInventoryPanel, false); } void LLLandmarksPanel::initLibraryInventoryPanel() @@ -499,7 +497,15 @@ void LLLandmarksPanel::initLibraryInventoryPanel() initLandmarksPanel(mLibraryInventoryPanel); - initAccordion("tab_library", mLibraryInventoryPanel); + // We want to fetch only "Landmarks" category from the library. + const LLUUID &landmarks_cat = gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK, false, true); + if (landmarks_cat.notNull()) + { + gInventory.startBackgroundFetch(landmarks_cat); + } + + // Expanding "Library" tab for new users who have no landmarks in "My Inventory". + initAccordion("tab_library", mLibraryInventoryPanel, true); } void LLLandmarksPanel::initLandmarksPanel(LLPlacesInventoryPanel* inventory_list) @@ -526,14 +532,14 @@ void LLLandmarksPanel::initLandmarksPanel(LLPlacesInventoryPanel* inventory_list inventory_list->saveFolderState(); } -void LLLandmarksPanel::initAccordion(const std::string& accordion_tab_name, LLPlacesInventoryPanel* inventory_list) +void LLLandmarksPanel::initAccordion(const std::string& accordion_tab_name, LLPlacesInventoryPanel* inventory_list, bool expand_tab) { LLAccordionCtrlTab* accordion_tab = getChild(accordion_tab_name); mAccordionTabs.push_back(accordion_tab); accordion_tab->setDropDownStateChangedCallback( boost::bind(&LLLandmarksPanel::onAccordionExpandedCollapsed, this, _2, inventory_list)); - accordion_tab->setDisplayChildren(false); + accordion_tab->setDisplayChildren(expand_tab); } void LLLandmarksPanel::onAccordionExpandedCollapsed(const LLSD& param, LLPlacesInventoryPanel* inventory_list) diff --git a/indra/newview/llpanellandmarks.h b/indra/newview/llpanellandmarks.h index 96b790844c..cbbd10ac26 100644 --- a/indra/newview/llpanellandmarks.h +++ b/indra/newview/llpanellandmarks.h @@ -110,7 +110,7 @@ private: void initMyInventoryPanel(); void initLibraryInventoryPanel(); void initLandmarksPanel(LLPlacesInventoryPanel* inventory_list); - void initAccordion(const std::string& accordion_tab_name, LLPlacesInventoryPanel* inventory_list); + void initAccordion(const std::string& accordion_tab_name, LLPlacesInventoryPanel* inventory_list, bool expand_tab); void onAccordionExpandedCollapsed(const LLSD& param, LLPlacesInventoryPanel* inventory_list); void deselectOtherThan(const LLPlacesInventoryPanel* inventory_list); -- cgit v1.2.3 From 41c6155f13dbb9ed8bc136bc3350bc8fc87e7f56 Mon Sep 17 00:00:00 2001 From: Ychebotarev ProductEngine Date: Thu, 4 Feb 2010 17:11:08 +0200 Subject: fix for normal EXT-3807 ABOUT LAND/OBJECTS: (i) icon is badly positioned --HG-- branch : product-engine --- indra/newview/llnamelistctrl.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 8c875c9b63..d579058c32 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -152,6 +152,7 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask) if (avatar_id.notNull()) { // ...valid avatar id + LLScrollListCell* hit_cell = hit_item->getColumn(column_index); if (hit_cell) { @@ -162,8 +163,8 @@ BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask) localRectToScreen(cell_rect, &sticky_rect); // Spawn at right side of cell - LLCoordGL pos( sticky_rect.mRight - 16, sticky_rect.mTop + (sticky_rect.getHeight()-16)/2 ); LLPointer icon = LLUI::getUIImage("Info_Small"); + LLCoordGL pos( sticky_rect.mRight - 16, sticky_rect.mTop - (sticky_rect.getHeight() - icon->getHeight())/2 ); // Should we show a group or an avatar inspector? bool is_group = hit_item->getValue()["is_group"].asBoolean(); -- cgit v1.2.3 From d2d192060993d938a2fd131f8872a60b678e4a04 Mon Sep 17 00:00:00 2001 From: "Brad Payne (Vir Linden)" Date: Thu, 4 Feb 2010 10:20:31 -0500 Subject: For EXT-4855: Crash on onWearableAssetFetch. Prevent late-arriving wearables from touching a deleted object. --- indra/newview/llappearancemgr.cpp | 47 +++++++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index 585d42f66d..0fe236c056 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -321,7 +321,7 @@ public: ~LLWearableHoldingPattern(); bool pollCompletion(); - bool isDone(); + bool isFetchCompleted(); bool isTimedOut(); typedef std::list found_list_t; @@ -330,10 +330,12 @@ public: LLInventoryModel::item_array_t mGestItems; S32 mResolved; LLTimer mWaitTime; + bool mFired; }; LLWearableHoldingPattern::LLWearableHoldingPattern(): - mResolved(0) + mResolved(0), + mFired(false) { } @@ -341,31 +343,34 @@ LLWearableHoldingPattern::~LLWearableHoldingPattern() { } -bool LLWearableHoldingPattern::isDone() +bool LLWearableHoldingPattern::isFetchCompleted() { - if (mResolved >= (S32)mFoundList.size()) - return true; // have everything we were waiting for - else if (isTimedOut()) - { - llwarns << "Exceeded max wait time, updating appearance based on what has arrived" << llendl; - return true; - } - return false; - + return (mResolved >= (S32)mFoundList.size()); // have everything we were waiting for? } bool LLWearableHoldingPattern::isTimedOut() { - static F32 max_wait_time = 15.0; // give up if wearable fetches haven't completed in max_wait_time seconds. + static F32 max_wait_time = 20.0; // give up if wearable fetches haven't completed in max_wait_time seconds. return mWaitTime.getElapsedTimeF32() > max_wait_time; } bool LLWearableHoldingPattern::pollCompletion() { - bool done = isDone(); - llinfos << "polling, done status: " << done << " elapsed " << mWaitTime.getElapsedTimeF32() << llendl; + bool completed = isFetchCompleted(); + bool timed_out = isTimedOut(); + bool done = completed || timed_out; + + llinfos << "polling, done status: " << completed << " timed out? " << timed_out << " elapsed " << mWaitTime.getElapsedTimeF32() << llendl; + if (done) { + mFired = true; + + if (timed_out) + { + llwarns << "Exceeded max wait time for wearables, updating appearance based on what has arrived" << llendl; + } + // Activate all gestures in this folder if (mGestItems.count() > 0) { @@ -397,7 +402,11 @@ bool LLWearableHoldingPattern::pollCompletion() LLAgentWearables::userUpdateAttachments(mObjItems); } - delete this; + if (completed) + { + // Only safe to delete if all wearable callbacks completed. + delete this; + } } return done; } @@ -432,7 +441,11 @@ static void removeDuplicateItems(LLInventoryModel::item_array_t& items) static void onWearableAssetFetch(LLWearable* wearable, void* data) { LLWearableHoldingPattern* holder = (LLWearableHoldingPattern*)data; - + if (holder->mFired) + { + llwarns << "called after holder fired" << llendl; + } + if(wearable) { for (LLWearableHoldingPattern::found_list_t::iterator iter = holder->mFoundList.begin(); -- cgit v1.2.3 From f2bb59300a0f17e10857b3fffebe669878f0fe50 Mon Sep 17 00:00:00 2001 From: Igor Borovkov Date: Thu, 4 Feb 2010 17:26:44 +0200 Subject: fixed duplicating of log records for EXT-4777 Implement saving and loading chat history for Nearby Chat (both plain text and widgeted chat) --HG-- branch : product-engine --- indra/newview/llnearbychat.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp index acb28bd46f..8fc11d3929 100644 --- a/indra/newview/llnearbychat.cpp +++ b/indra/newview/llnearbychat.cpp @@ -200,11 +200,16 @@ void LLNearbyChat::addMessage(const LLChat& chat,bool archive,const LLSD &args) mMessageArchive.push_back(chat); if(mMessageArchive.size()>200) mMessageArchive.erase(mMessageArchive.begin()); + } - if (gSavedPerAccountSettings.getBOOL("LogChat")) - { - LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText); - } + if (args["do_not_log"].asBoolean()) + { + return; + } + + if (gSavedPerAccountSettings.getBOOL("LogChat")) + { + LLLogChat::saveHistory("chat", chat.mFromName, chat.mFromID, chat.mText); } } @@ -275,6 +280,9 @@ void LLNearbyChat::processChatHistoryStyleUpdate(const LLSD& newvalue) void LLNearbyChat::loadHistory() { + LLSD do_not_log; + do_not_log["do_not_log"] = true; + std::list history; LLLogChat::loadAllHistory("chat", history); @@ -295,7 +303,7 @@ void LLNearbyChat::loadHistory() chat.mFromID = from_id; chat.mText = msg[IM_TEXT].asString(); chat.mTimeStr = msg[IM_TIME].asString(); - addMessage(chat); + addMessage(chat, true, do_not_log); it++; } -- cgit v1.2.3 From c99fb12b3d300705dbf6eb68b1a3f22927d4d221 Mon Sep 17 00:00:00 2001 From: Dmitry Zaporozhan Date: Thu, 4 Feb 2010 17:25:30 +0200 Subject: Update for low bug EXT-4951 - Redundant edit box context menu in list items in Panel Picks/Classifieds Disabled edit box context menu in classified list items. --HG-- branch : product-engine --- indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml b/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml index b881719e3a..0c1418fc2d 100644 --- a/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml +++ b/indra/newview/skins/default/xui/en/panel_classifieds_list_item.xml @@ -64,6 +64,7 @@ layout="topleft" left="103" name="description" + textbox.mouse_opaque="false" top_pad="0" width="178" word_wrap="true" /> -- cgit v1.2.3 From 78200e2c1c1bc2e53f694b2ae086f486a7f0095c Mon Sep 17 00:00:00 2001 From: Alexei Arabadji Date: Thu, 4 Feb 2010 19:10:24 +0200 Subject: =?UTF-8?q?fixed=20EXT-4893=20=E2=80=9C'Add=20friend'=20available?= =?UTF-8?q?=20for=20friends=20in=20group/conference=20sessions=E2=80=9D,?= =?UTF-8?q?=20corrected=20condition=20for=20enable=20'add=20friend'=20menu?= =?UTF-8?q?=20item;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --HG-- branch : product-engine --- indra/newview/llparticipantlist.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/newview/llparticipantlist.cpp b/indra/newview/llparticipantlist.cpp index ad47e351ee..1c4004c37a 100644 --- a/indra/newview/llparticipantlist.cpp +++ b/indra/newview/llparticipantlist.cpp @@ -584,7 +584,7 @@ bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD& { std::string item = userdata.asString(); if (item == "can_mute_text" || "can_block" == item || "can_share" == item || "can_im" == item - || "can_pay" == item || "can_add" == item) + || "can_pay" == item) { return mUUIDs.front() != gAgentID; } @@ -619,7 +619,7 @@ bool LLParticipantList::LLParticipantListMenu::enableContextMenuItem(const LLSD& for (;id != uuids_end; ++id) { - if ( LLAvatarActions::isFriend(*id) ) + if ( *id == gAgentID || LLAvatarActions::isFriend(*id) ) { result = false; break; -- cgit v1.2.3 From 3fa2acc0df76b3dd81e295a28bfb463f863a9e49 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Thu, 4 Feb 2010 19:21:12 +0200 Subject: Fixed bug EXT-4806 (Snapshot floater has preview offset). Removed incorrect vertical offset modification in compact mode. --HG-- branch : product-engine --- indra/newview/llfloatersnapshot.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/indra/newview/llfloatersnapshot.cpp b/indra/newview/llfloatersnapshot.cpp index b6e9fb3f6c..a0031f0193 100644 --- a/indra/newview/llfloatersnapshot.cpp +++ b/indra/newview/llfloatersnapshot.cpp @@ -2084,10 +2084,6 @@ void LLFloaterSnapshot::draw() S32 offset_x = (getRect().getWidth() - previewp->getThumbnailWidth()) / 2 ; S32 offset_y = thumbnail_rect.mBottom + (thumbnail_rect.getHeight() - previewp->getThumbnailHeight()) / 2 ; - if (! gSavedSettings.getBOOL("AdvanceSnapshot")) - { - offset_y += getUIWinHeightShort() - getUIWinHeightLong(); - } glMatrixMode(GL_MODELVIEW); gl_draw_scaled_image(offset_x, offset_y, -- cgit v1.2.3 From 1bc67a9d725b88a0ebdde77cef928abd33fa9cf6 Mon Sep 17 00:00:00 2001 From: richard Date: Thu, 4 Feb 2010 10:25:31 -0800 Subject: EXT-4625 - Chat bar doesn't display trailing character on some strings reviewed by Leyla --- indra/llrender/llfontgl.cpp | 24 ++++++++++++++++++++---- indra/llui/lllineeditor.cpp | 6 +++++- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 1de1d6ded4..b6a6b448ee 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -601,14 +601,20 @@ S32 LLFontGL::firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_ { llwchar wch = wchars[i]; - F32 char_width = mFontFreetype->getXAdvance(wch); + const LLFontGlyphInfo* fgi= mFontFreetype->getGlyphInfo(wch); + + // last character uses character width, since the whole character needs to be visible + // other characters just use advance + F32 width = (i == start) + ? (F32)(fgi->mWidth + fgi->mXBearing) // use actual width for last character + : fgi->mXAdvance; // use advance for all other characters - if( scaled_max_pixels < (total_width + char_width) ) + if( scaled_max_pixels < (total_width + width) ) { break; } - total_width += char_width; + total_width += width; drawable_chars++; if( max_chars >= 0 && drawable_chars >= max_chars ) @@ -626,7 +632,17 @@ S32 LLFontGL::firstDrawableChar(const llwchar* wchars, F32 max_pixels, S32 text_ total_width = llround(total_width); } - return start_pos - drawable_chars; + if (drawable_chars == 0) + { + return start_pos; // just draw last character + } + else + { + // if only 1 character is drawable, we want to return start_pos as the first character to draw + // if 2 are drawable, return start_pos and character before start_pos, etc. + return start_pos + 1 - drawable_chars; + } + } S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, S32 begin_offset, F32 target_x, F32 max_pixels, S32 max_chars, BOOL round) const diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index cb5aea272d..2cdcd3345e 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -422,12 +422,16 @@ void LLLineEditor::setCursor( S32 pos ) S32 old_cursor_pos = getCursor(); mCursorPos = llclamp( pos, 0, mText.length()); + // position of end of next character after cursor S32 pixels_after_scroll = findPixelNearestPos(); if( pixels_after_scroll > mTextRightEdge ) { S32 width_chars_to_left = mGLFont->getWidth(mText.getWString().c_str(), 0, mScrollHPos); S32 last_visible_char = mGLFont->maxDrawableChars(mText.getWString().c_str(), llmax(0.f, (F32)(mTextRightEdge - mTextLeftEdge + width_chars_to_left))); - S32 min_scroll = mGLFont->firstDrawableChar(mText.getWString().c_str(), (F32)(mTextRightEdge - mTextLeftEdge), mText.length(), getCursor()); + // character immediately to left of cursor should be last one visible (SCROLL_INCREMENT_ADD will scroll in more characters) + // or first character if cursor is at beginning + S32 new_last_visible_char = llmax(0, getCursor() - 1); + S32 min_scroll = mGLFont->firstDrawableChar(mText.getWString().c_str(), (F32)(mTextRightEdge - mTextLeftEdge), mText.length(), new_last_visible_char); if (old_cursor_pos == last_visible_char) { mScrollHPos = llmin(mText.length(), llmax(min_scroll, mScrollHPos + SCROLL_INCREMENT_ADD)); -- cgit v1.2.3