is there a way to do this?

i made a list of object in my scene in gui. then i made a style for them, so that when mouse hovers over the labels for each object, font turnes yellow. so the question is: is there a way to use this hover detection and avoid checking the mouse position for each label, also the problem is that gui is nested few levels and it will be hard to get absolute position so that i can use rectangle.Contains(invertedMousePosition)

is there a way to use hover detection somehow?

Without checking if the rectangle contains your mouseposotion, there isnt any other way as far as i know.

However, im using nested GUI and i dont experience any problems with position. Im using Event.current.mousePos, instead of Input.mousePosition. Please check if this works.

If you use the same rect that you're using to draw inside the group, then rectangle.Contains(Event.current.mousePosition) will work perfectly, without having to invert it or anything