getEventRelativeTo() changed?


#1

Hey, im trying to debug some complex code i wrote, and im wondering if getEventRelativeTo() has been changed in any way?


#2

No, don’t think so.


#3

I think I encounter the same problem.
I upgraded from 1.46 to 1.50 (I have done a checkout just before the 1.51 release :frowning: ) and I have problems with component calling recursively getEventRelativeTo() in mouseDown

For instance:

void ChildComp::mouseDown(const MouseEvent& e)
 {
	 Component* parent = getParentComponent();
	 if(parent)
		 parent->mouseDown(e.getEventRelativeTo(parent));
 }

Am I doing something wrong?

[edit]
I looked a little bit in the MouseEvent code and I think this is because eventComponent is always initialized with originator so it is not updated with otherComponent as it was in 1.46 code
I added the eventComponent to the constructor and it solved my problem.

Kevin


#4

Ah - I think you might be right there… Thanks, I’ll sanity-check that right away!