Skip to content

Commit

Permalink
Fix text layout (diegomura#579)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomura authored Apr 20, 2019
1 parent 0e68761 commit 120d9ef
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/elements/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,15 @@ class Text extends Base {
return { height: this.linesHeight };
}

if (widthMode === Yoga.MEASURE_MODE_AT_MOST) {
this.layoutText(width, height);

return {
height: this.linesHeight,
width: Math.min(width, this.linesWidth),
};
}

return {};
}

Expand Down

0 comments on commit 120d9ef

Please sign in to comment.