Use layout width for BoringLayout in Nodes

Summary:
In D2980358, alignment was implemented for nodes. This unfortunately
introduced a bug, which is that when we have a BoringLayout that is set to
ALIGN_CENTER, it can't be seen. This is a result of the fact that the width
passed in to BoringLayout is Integer.MAX_VALUE. Since measure has already
been called at this point, we can just pass the layout's width as the width
of the BoringLayout.

Reviewed By: sriramramani

Differential Revision: D3004971
This commit is contained in:
Ahmed El-Helw 2016-03-03 13:44:17 -08:00
Родитель 45472fe400
Коммит 9498f22439
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -173,7 +173,7 @@ import com.facebook.react.uimanager.annotations.ReactProp;
mDrawCommand = new DrawTextLayout(new BoringLayout(
mText,
PAINT,
Integer.MAX_VALUE, // fits one line so don't care about the width
(int) getLayoutWidth(),
mAlignment,
mSpacingMult,
mSpacingAdd,