Fabric/Text: RCTParagraphComponentView

Summary: RCTParagraphComponentView is a UIView which can render text using TextLayoutManager.

Reviewed By: mdvacca

Differential Revision: D7751853

fbshipit-source-id: e6ee9a0f989cdf6e878390d37dbcf8a11ef90bf4
This commit is contained in:
Valentin Shergin
2018-05-08 18:50:10 -07:00
committed by Facebook Github Bot
parent 9646c5cb3c
commit 81bdd36204
3 changed files with 108 additions and 0 deletions

View File

@@ -23,6 +23,13 @@ struct LayoutMetrics {
DisplayType displayType {DisplayType::Flex};
LayoutDirection layoutDirection {LayoutDirection::Undefined};
Rect getContentFrame() const {
return Rect {
Point {contentInsets.left, contentInsets.top},
Size {frame.size.width - contentInsets.left - contentInsets.right, frame.size.height - contentInsets.top - contentInsets.bottom}
};
}
bool operator ==(const LayoutMetrics& rhs) const {
return
std::tie(this->frame, this->contentInsets, this->borderWidth, this->displayType, this->layoutDirection) ==