/// <summary> /// Dispatches a batch of updates. /// </summary> /// <param name="absoluteX"> /// The absolute X-position of the node. /// </param> /// <param name="absoluteY"> /// The /// </param> /// <param name="uiViewOperationQueue"> /// Interface for enqueueing UI operations. /// </param> /// <param name="nativeViewHierarchyOptimizer"> /// Interface for optimizing native hierarchy calls. /// </param> /// <returns> /// <code>true</code> if updates were dispatched, otherwise <code>false</code>. /// </returns> internal bool DispatchUpdates( float absoluteX, float absoluteY, UIViewOperationQueue uiViewOperationQueue, NativeViewHierarchyOptimizer nativeViewHierarchyOptimizer) { if (_nodeUpdated) { OnCollectExtraUpdates(uiViewOperationQueue); } if (HasNewLayout) { _absoluteLeft = absoluteX + LayoutX; _absoluteTop = absoluteY + LayoutY; _absoluteRight = absoluteX + LayoutX + LayoutWidth; _absoluteBottom = absoluteY + LayoutY + LayoutHeight; nativeViewHierarchyOptimizer.HandleUpdateLayout(this); return(true); } else { return(false); } }
/// <summary> /// Dispatches a batch of updates. /// </summary> /// <param name="uiViewOperationQueue"> /// Interface for enqueueing UI operations. /// </param> /// <param name="nativeViewHierarchyOptimizer"> /// Interface for optimizing native hierarchy calls. /// </param> internal void DispatchUpdates( UIViewOperationQueue uiViewOperationQueue, NativeViewHierarchyOptimizer nativeViewHierarchyOptimizer) { if (_nodeUpdated) { OnCollectExtraUpdates(uiViewOperationQueue); } if (HasNewLayout) { nativeViewHierarchyOptimizer.HandleUpdateLayout(this); } }
/// <summary> /// Dispatches a batch of updates. /// </summary> /// <param name="absoluteX"> /// The absolute X-position of the node. /// </param> /// <param name="absoluteY"> /// The /// </param> /// <param name="uiViewOperationQueue"> /// Interface for enqueueing UI operations. /// </param> /// <param name="nativeViewHierarchyOptimizer"> /// Interface for optimizing native hierarchy calls. /// </param> /// <returns> /// <code>true</code> if updates were dispatched, otherwise <code>false</code>. /// </returns> internal bool DispatchUpdates( float absoluteX, float absoluteY, UIViewOperationQueue uiViewOperationQueue, NativeViewHierarchyOptimizer nativeViewHierarchyOptimizer) { if (_nodeUpdated) { OnCollectExtraUpdates(uiViewOperationQueue); } if (HasNewLayout) { var layoutX = LayoutX; var layoutY = LayoutY; var newAbsoluteLeft = (int)Math.Round(absoluteX + layoutX); var newAbsoluteTop = (int)Math.Round(absoluteY + layoutY); var newAbsoluteRight = (int)Math.Round(absoluteX + layoutX + LayoutWidth); var newAbsoluteBottom = (int)Math.Round(absoluteY + layoutY + LayoutHeight); var newScreenX = (int)Math.Round(layoutX); var newScreenY = (int)Math.Round(layoutY); var newScreenWidth = newAbsoluteRight - newAbsoluteLeft; var newScreenHeight = newAbsoluteBottom - newAbsoluteTop; var layoutHasChanged = MustForceLayout || newScreenX != ScreenX || newScreenY != ScreenY || newScreenWidth != ScreenWidth || newScreenHeight != ScreenHeight; ScreenX = newScreenX; ScreenY = newScreenY; ScreenWidth = newScreenWidth; ScreenHeight = newScreenHeight; if (layoutHasChanged) { nativeViewHierarchyOptimizer.HandleUpdateLayout(this); } return(layoutHasChanged); } else { return(false); } }
/// <summary> /// Dispatches a batch of updates. /// </summary> /// <param name="absoluteX">The absolute x-coordinate.</param> /// <param name="absoluteY">The absolute y-coordinate.</param> /// <param name="uiViewOperationQueue"> /// Interface for enqueueing UI operations. /// </param> /// <param name="nativeViewHierarchyOptimizer"> /// Interface for optimizing native hierarchy calls. /// </param> internal void DispatchUpdates( double absoluteX, double absoluteY, UIViewOperationQueue uiViewOperationQueue, NativeViewHierarchyOptimizer nativeViewHierarchyOptimizer) { if (_nodeUpdated) { OnCollectExtraUpdates(uiViewOperationQueue); } if (HasNewLayout) { _absoluteLeft = (int)Math.Round(absoluteX + LayoutX); _absoluteTop = (int)Math.Round(absoluteY + LayoutY); _absoluteRight = (int)Math.Round(_absoluteLeft + LayoutWidth); _absoluteBottom = (int)Math.Round(_absoluteTop + LayoutHeight); nativeViewHierarchyOptimizer.HandleUpdateLayout(this); } }