Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public void onAfterUpdateTransaction() {
public void onCollectExtraUpdates(UIViewOperationQueue uiViewOperationQueue) {
}

/* package */ void dispatchUpdates(
/* package */ boolean dispatchUpdates(
float absoluteX,
float absoluteY,
UIViewOperationQueue uiViewOperationQueue,
Expand All @@ -201,12 +201,27 @@ public void onCollectExtraUpdates(UIViewOperationQueue uiViewOperationQueue) {
}

if (hasNewLayout()) {
mAbsoluteLeft = Math.round(absoluteX + getLayoutX());
mAbsoluteTop = Math.round(absoluteY + getLayoutY());
mAbsoluteRight = Math.round(absoluteX + getLayoutX() + getLayoutWidth());
mAbsoluteBottom = Math.round(absoluteY + getLayoutY() + getLayoutHeight());
float newLeft = Math.round(absoluteX + getLayoutX());
float newTop = Math.round(absoluteY + getLayoutY());
float newRight = Math.round(absoluteX + getLayoutX() + getLayoutWidth());
float newBottom = Math.round(absoluteY + getLayoutY() + getLayoutHeight());

if (newLeft == mAbsoluteLeft &&
newRight == mAbsoluteRight &&
newTop == mAbsoluteTop &&
newBottom == mAbsoluteBottom) {
return false;
}

mAbsoluteLeft = newLeft;
mAbsoluteTop = newTop;
mAbsoluteRight = newRight;
mAbsoluteBottom = newBottom;

nativeViewHierarchyOptimizer.handleUpdateLayout(this);
return true;
} else {
return false;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -755,14 +755,14 @@ protected void applyUpdatesRecursive(

int tag = cssNode.getReactTag();
if (!mShadowNodeRegistry.isRootNode(tag)) {
cssNode.dispatchUpdates(
boolean frameDidChange = cssNode.dispatchUpdates(
absoluteX,
absoluteY,
mOperationsQueue,
mNativeViewHierarchyOptimizer);

// notify JS about layout event if requested
if (cssNode.shouldNotifyOnLayout()) {
if (frameDidChange && cssNode.shouldNotifyOnLayout()) {
eventDispatcher.dispatchEvent(
OnLayoutEvent.obtain(
tag,
Expand Down