I am trying to update every 2 seconds, some text information on the nodes in a GoDocument. However, for performance reasons, I would be interesting in updating only the nodes that the user sees, that is the nodes in the View.
I have tried with browsing through the nodes in GoDocument and querrying IsInView property. However this returns always ‘false’.
Is there any other way to tell which GoObjects are present in a GoView?
GoObject.IsInView is true when the object belongs to a GoView rather than to a GoDocument. (And naturally GoObject.IsInDocument is the opposite. And both will be false if the object doesn’t belong to any layer.)
For each node you want to consider, check whether its Bounds intersects with GoView.DocExtent.