Permalink
Browse files

UI: Pass UNSPECIFIED through on scroll views.

Otherwise we could end up with zero width things, just because they wrap
content.
  • Loading branch information...
unknownbrackets committed Dec 12, 2017
1 parent 52ee2f7 commit d9282d4e76c96dd6d0dace872abe1f3d65a85575
Showing with 2 additions and 2 deletions.
  1. +2 −2 ext/native/ui/viewgroup.cpp
@@ -636,14 +636,14 @@ void ScrollView::Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec ver
if (views_.size()) {
if (orientation_ == ORIENT_HORIZONTAL) {
MeasureSpec v = MeasureSpec(AT_MOST, measuredHeight_ - margins.vert());
if (measuredHeight_ == 0.0f && layoutParams_->height == WRAP_CONTENT) {
if (measuredHeight_ == 0.0f && (vert.type == UNSPECIFIED || layoutParams_->height == WRAP_CONTENT)) {
v.type = UNSPECIFIED;
}
views_[0]->Measure(dc, MeasureSpec(UNSPECIFIED, measuredWidth_), v);
MeasureBySpec(layoutParams_->height, views_[0]->GetMeasuredHeight(), vert, &measuredHeight_);
} else {
MeasureSpec h = MeasureSpec(AT_MOST, measuredWidth_ - margins.horiz());
if (measuredWidth_ == 0.0f && layoutParams_->width == WRAP_CONTENT) {
if (measuredWidth_ == 0.0f && (horiz.type == UNSPECIFIED || layoutParams_->width == WRAP_CONTENT)) {
h.type = UNSPECIFIED;
}
views_[0]->Measure(dc, h, MeasureSpec(UNSPECIFIED, measuredHeight_));

0 comments on commit d9282d4

Please sign in to comment.