@Dominic.Lerbs wrote:
Hi,
I am using the
go.Rect.unionRectfunction to create a Rect for multiple GraphObjects:let allBounds: go.Rect; graphObjects.each(panel => { let bounds = new go.Rect(panel.getDocumentPoint(go.Spot.TopLeft), panel.getDocumentPoint(go.Spot.RightCenter)); // bounds.bottom = 540 if (!allBounds) { allBounds = bounds; } else { allBounds = allBounds.unionRect(bounds); } // allBounds.bottom = 539.9999999999999 // In some other place: allBounds.containsPoint(bounds) => false });The most bottom GraphObject has a bottom coordinate of 540.
However, the resulting union Rect has a bottom coordinate of 539.9999999999999.This is not good as I am later using go.Rect.containsPoint() Method which returns false.
Any advice?
Posts: 1
Participants: 1