// Update the metrics of this node. public override void UpdateMetrics(TextLayout layout, bool force) { if(force || !valid) { // clear the metrics information size = Size.Empty; // get the first child of this group TextNode child = first; // update child metrics and add to group's metrics while(child != null) { // update the child's metrics information child.UpdateMetrics(layout, force); // add the metrics information size = layout.AddMetrics(size, child.size); // move to the next child child = child.next; } // flag that the metrics information is now valid valid = true; } }