diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 4991c4afa641a3139f3e289534d70a08a8c12a99..0e7060e22cfc887157bdfceb40ceb5c38b1a4d40 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -47,6 +47,19 @@ void LLLayoutStack::OrientationNames::declareValues()
 //
 // LLLayoutPanel
 //
+LLLayoutPanel::Params::Params()	
+:	expanded_min_dim("expanded_min_dim", 0),
+	min_dim("min_dim", 0),
+	max_dim("max_dim", S32_MAX),
+	user_resize("user_resize", true),
+	auto_resize("auto_resize", true)
+{
+	addSynonym(min_dim, "min_width");
+	addSynonym(min_dim, "min_height");
+	addSynonym(max_dim, "max_width");
+	addSynonym(max_dim, "max_height");
+}
+
 LLLayoutPanel::LLLayoutPanel(const Params& p)	
 :	LLPanel(p),
 	mExpandedMinDimSpecified(false),
@@ -527,8 +540,8 @@ void LLLayoutStack::updateLayout(BOOL force_resize)
 	// not enough room to fit existing contents
 	if (force_resize == FALSE
 		// layout did not complete by reaching target position
-		&& ((mOrientation == VERTICAL && cur_y != -mPanelSpacing)
-			|| (mOrientation == HORIZONTAL && cur_x != getRect().getWidth() + mPanelSpacing)))
+		&& ((mOrientation == VERTICAL && llround(cur_y) != -mPanelSpacing)
+			|| (mOrientation == HORIZONTAL && llround(cur_x) != getRect().getWidth() + mPanelSpacing)))
 	{
 		// do another layout pass with all stacked elements contributing
 		// even those that don't usually resize
diff --git a/indra/llui/lllayoutstack.h b/indra/llui/lllayoutstack.h
index 5d79505fc36b5eea4b1ce9ec94599cb7791e5438..ede6149a800da8c15b6de93079cb2845a767d0e5 100644
--- a/indra/llui/lllayoutstack.h
+++ b/indra/llui/lllayoutstack.h
@@ -161,18 +161,7 @@ friend class LLUICtrlFactory;
 		Optional<bool>			user_resize,
 								auto_resize;
 
-		Params()
-		:	expanded_min_dim("expanded_min_dim", 0),
-			min_dim("min_dim", 0),
-			max_dim("max_dim", 0),
-			user_resize("user_resize", true),
-			auto_resize("auto_resize", true)
-		{
-			addSynonym(min_dim, "min_width");
-			addSynonym(min_dim, "min_height");
-			addSynonym(max_dim, "max_width");
-			addSynonym(max_dim, "max_height");
-		}
+		Params();
 	};
 
 	~LLLayoutPanel();