Labels: Type-Defect Priority-Medium Component-Extras
New issue 235 by atdi...@gmail.com: PSwingEventHandler doesn't dispatch
events to nodes at extreme scales
User John Marteens reported an error where a Swing component (within a
PSwing) does not get mouse events when that component is within a node
lineage that has extreme scale transforms.
For example, if a PSwing is within a parent node with scale = 0.001, events
are not fired for the component. (I've reproduced this particular case on
John provided a suggested patch that fixes his particular case:
=== PSwingEventHandler ===
if (currentNode instanceof PSwing &&
final PSwing swing = (PSwing) currentNode;
final PNode grabNode = pickedNode;
point = new Point(mEvent.getX(), mEvent.getY());
//jmes 20111230 replaced
Point2D.Double pt2D = new Point2D.Double(mEvent.getX(),
//jmes 20111230 end replaced
prevPoint = (Point) point.clone();
=== END ===
Essentially, the integer Point object does not survive the cameraToLocal
math. John found that using a Point2D.Double fixes his particular problem.
Does anyone see anything wrong with his solution?
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en