Skip to content

Commit

Permalink
fix(ios): fix modal view layout issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ruifanyuan committed Oct 19, 2023
1 parent 0f6a9a9 commit d15b474
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ @interface NativeRenderObjectModalHost : HippyShadowView

@implementation NativeRenderObjectModalHost

- (void)insertNativeRenderSubview:(NativeRenderObjectView *)subview atIndex:(NSInteger)atIndex{
[super insertNativeRenderSubview:subview atIndex:atIndex];
CGRect frame = { .origin = CGPointZero, .size = NativeRenderScreenSize() };
[subview setLayoutFrame:frame];
}

- (void)setDomManager:(std::weak_ptr<hippy::DomManager>)domManager {
[super setDomManager:domManager];
CGRect frame = { .origin = CGPointZero, .size = NativeRenderScreenSize() };
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,14 @@ - (void)setLayoutFrame:(CGRect)frame dirtyPropagation:(BOOL)dirtyPropagation {
node->SetLayoutSize(frame.size.width, frame.size.height);
std::vector<std::shared_ptr<hippy::DomNode>> changed_nodes;
node->DoLayout(changed_nodes);
if (!changed_nodes.empty()) {
renderManager->UpdateLayout(strongSelf.rootNode, changed_nodes);
}
if (dirtyPropagation) {
[strongSelf dirtyPropagation:NativeRenderUpdateLifecycleLayoutDirtied];
}
renderManager->EndBatch(strongSelf.rootNode);
if (!changed_nodes.empty()) {
if(auto renderManager = domManager->GetRenderManager().lock()){
renderManager->UpdateLayout(strongSelf.rootNode, changed_nodes);
}
}
}
}};
domManager->PostTask(hippy::dom::Scene(std::move(ops)));
Expand Down

0 comments on commit d15b474

Please sign in to comment.