You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given: org.gephi.preview.spi.PreviewMouseListener is implemented and added to the corresponding Renderer in a module.
Expected Behaviour
When clicking on a node of a graph in the Preview Mode, PreviewMouseEvent coordinates received in PreviewMouseListener::mouseClicked(PreviewMouseEvent pme, ...) method correspond to PreviewModel's actual coordinates.
Current Behavior
PreviewMouseEvent coordinates received in PreviewMouseListener::mouseClicked(PreviewMouseEvent pme, ...) method is wrong.
When clicking on a node in the Preview Mode, the coordinates from the mentioned method do not correspond to the coordinates of the corresponding node in the PreviewModel.
Possible Solution
org.gephi.desktop.preview.PreviewSketch.java:
...
private Vector screenPositionToModelPosition(Vector screenPos) {
Vector center = new Vector(getWidth() / 2f, getHeight() / 2f);
Vector scaledCenter = Vector.mult(center, target.getScaling());
Vector scaledTrans = Vector.sub(center, scaledCenter);
Vector modelPos = new Vector(screenPos.x, screenPos.y);
modelPos.sub(scaledTrans);
modelPos.mult(scaleFactor); // <---- This line is missing
modelPos.div(target.getScaling());
modelPos.sub(target.getTranslate());
return modelPos;
}
...
Steps to Reproduce
Implement org.gephi.preview.spi.PreviewMouseListener according to the documentation and add it to some module.
Install the module.
Build/load some graph.
Go to the Preview Mode and click on some node of the graph.
Check if coordinates received in PreviewMouseListener::mouseClicked method correspond to the actual box of the node being clicked.
Context
It doesn't affect me directly because I fixed it for my own purpose.
However it's a bug for further development of Gephi Platform.
Your Environment
Version used: Gephi 0.9.6
Operating System: MacOS, M1.
The text was updated successfully, but these errors were encountered:
Given: org.gephi.preview.spi.PreviewMouseListener is implemented and added to the corresponding Renderer in a module.
Expected Behaviour
When clicking on a node of a graph in the Preview Mode, PreviewMouseEvent coordinates received in PreviewMouseListener::mouseClicked(PreviewMouseEvent pme, ...) method correspond to PreviewModel's actual coordinates.
Current Behavior
PreviewMouseEvent coordinates received in PreviewMouseListener::mouseClicked(PreviewMouseEvent pme, ...) method is wrong.
When clicking on a node in the Preview Mode, the coordinates from the mentioned method do not correspond to the coordinates of the corresponding node in the PreviewModel.
Possible Solution
org.gephi.desktop.preview.PreviewSketch.java:
Steps to Reproduce
Context
It doesn't affect me directly because I fixed it for my own purpose.
However it's a bug for further development of Gephi Platform.
Your Environment
The text was updated successfully, but these errors were encountered: