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:
parent
45472fe400
commit
9498f22439
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue