From 8923bd46e7dfe0ab45f4bab5352550dca8f949b8 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Tue, 22 Dec 2015 20:45:18 -0800 Subject: [PATCH] Support AT_MOST for WRAP_CONTENT. --- ext/native/ui/view.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/native/ui/view.cpp b/ext/native/ui/view.cpp index 15d92bcb78..4ec1c965f3 100644 --- a/ext/native/ui/view.cpp +++ b/ext/native/ui/view.cpp @@ -95,8 +95,10 @@ bool IsFocusMovementEnabled() { void MeasureBySpec(Size sz, float contentWidth, MeasureSpec spec, float *measured) { *measured = sz; if (sz == WRAP_CONTENT) { - if (spec.type == UNSPECIFIED || spec.type == AT_MOST) + if (spec.type == UNSPECIFIED) *measured = contentWidth; + else if (spec.type == AT_MOST) + *measured = contentWidth < spec.size ? contentWidth : spec.size; else if (spec.type == EXACTLY) *measured = spec.size; } else if (sz == FILL_PARENT) {