diff --git a/linden/indra/llimage/llpngwrapper.cpp b/linden/indra/llimage/llpngwrapper.cpp index 0dd991a63..627d0d7e7 100644 --- a/linden/indra/llimage/llpngwrapper.cpp +++ b/linden/indra/llimage/llpngwrapper.cpp @@ -216,7 +216,8 @@ void LLPngWrapper::normalizeImage() } if (mColorType == PNG_COLOR_TYPE_GRAY && mBitDepth < 8) { - png_set_gray_1_2_4_to_8(mReadPngPtr); + /*png_set_gray_1_2_4_to_8(mReadPngPtr);*/ + png_set_expand_gray_1_2_4_to_8(mReadPngPtr); } if (mColorType == PNG_COLOR_TYPE_GRAY || mColorType == PNG_COLOR_TYPE_GRAY_ALPHA) @@ -364,7 +365,8 @@ void LLPngWrapper::releaseResources() { if (mReadPngPtr || mReadInfoPtr) { - png_destroy_read_struct(&mReadPngPtr, &mReadInfoPtr, png_infopp_NULL); + png_destroy_read_struct(&mReadPngPtr, &mReadInfoPtr, NULL); + /*png_destroy_read_struct(&mReadPngPtr, &mReadInfoPtr, png_infopp_NULL);*/ mReadPngPtr = NULL; mReadInfoPtr = NULL; } diff --git a/linden/indra/llimage/llpngwrapper.h b/linden/indra/llimage/llpngwrapper.h index 2e6c1dc22..2c33592bb 100644 --- a/linden/indra/llimage/llpngwrapper.h +++ b/linden/indra/llimage/llpngwrapper.h @@ -32,7 +32,8 @@ #ifndef LL_LLPNGWRAPPER_H #define LL_LLPNGWRAPPER_H -#include "libpng12/png.h" +#include "libpng14/png.h" +/*#include "libpng12/png.h"*/ #include "llimage.h" class LLPngWrapper diff --git a/linden/indra/llui/llmenugl.cpp b/linden/indra/llui/llmenugl.cpp index 91bb58120..d2796afca 100644 --- a/linden/indra/llui/llmenugl.cpp +++ b/linden/indra/llui/llmenugl.cpp @@ -2233,13 +2233,32 @@ void LLMenuGL::arrange( void ) if (mHorizontalLayout) { item_list_t::iterator item_iter; + item_list_t::iterator next_item_iter; for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) { if ((*item_iter)->getVisible()) { + + // Add the next item in the list to be checked. This is done + // to make sure that there is not just one extra item in the spillover + // list. You do not want to just keep the last one if it is too long + // in case it is drop down list. + U32 testWidth = width; + next_item_iter = item_iter; + if(++next_item_iter != mItems.end()) { + testWidth += (*next_item_iter)->getNominalWidth(); + if( ((*next_item_iter)->getType() == "separator") || + ((*next_item_iter)->getType() == "tearoff_menu") ) { + if(++next_item_iter != mItems.end()) { + testWidth += (*next_item_iter)->getNominalWidth(); + } + } + + } + if (!getTornOff() && item_iter != mItems.begin() // Don't spillover the first item! - && width + (*item_iter)->getNominalWidth() > max_width - spillover_item_width) + && testWidth + (*item_iter)->getNominalWidth() > max_width - spillover_item_width) { // no room for any more items createSpilloverBranch(); @@ -2272,13 +2291,32 @@ void LLMenuGL::arrange( void ) else { item_list_t::iterator item_iter; + item_list_t::iterator next_item_iter; for (item_iter = mItems.begin(); item_iter != mItems.end(); ++item_iter) { if ((*item_iter)->getVisible()) { + + // Add the next item in the list to be checked. This is done + // to make sure that there is not just one extra item in the spillover + // list. You do not want to just keep the last one if it is too long + // in case it is drop down list. + U32 testHeight = height; + next_item_iter = item_iter; + if(++next_item_iter != mItems.end()) { + testHeight += (*next_item_iter)->getNominalHeight(); + if( ((*next_item_iter)->getType() == "separator") || + ((*next_item_iter)->getType() == "tearoff_menu") ) { + if(++next_item_iter != mItems.end()) { + testHeight += (*next_item_iter)->getNominalHeight(); + } + } + + } + if (!getTornOff() && item_iter != mItems.begin() // Don't spillover the first item! - && height + (*item_iter)->getNominalHeight() > max_height - spillover_item_height) + && testHeight + (*item_iter)->getNominalHeight() > max_height - spillover_item_height) { // no room for any more items createSpilloverBranch();