How do I get the link halo location to be right above the mouse click? #2805
Unanswered
james-ep01
asked this question in
Q&A
Replies: 2 comments 1 reply
-
I expects paper coordinates here. You can also define it as function, so it reevaluated when the paper transformation changes. new Halo({
bbox: () => paper.localToPaperRect({ x, y , width: 20, height: 20 }),
}); Note: this should be defined in the model coordinates (we will change this in the next major version). |
Beta Was this translation helpful? Give feedback.
0 replies
-
It's working well, thank you. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Introduction
The link halo location changes depending on the paper size. Below is the sauce I made. I don't know the coordinates of the ebt and the coordinates of link clicks such as x and y.
this.paper.on('link:pointerclick', function(linkView,evt,x,y) {
joint.ui.Halo.clear(linkView.paper);
var coodinate = {x: x, y:y , width: 20,height: 20 };
createLinkHalo( linkView , coodinate );
});
//...............
createLinkHalo = function (cellView , coodinate ) {
const cell = cellView.model;
const options = {
cellView: cellView,
type: 'toolbar',
bbox: coodinate,
};
const halo = new joint.ui.Halo(options);
halo.render();
};
This is the location image of the first working halo.
![image](https://private-user-images.githubusercontent.com/188142734/388793476-9a08dd81-1117-41cc-b3d2-b2e74a75287d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxODk2MzksIm5iZiI6MTczOTE4OTMzOSwicGF0aCI6Ii8xODgxNDI3MzQvMzg4NzkzNDc2LTlhMDhkZDgxLTExMTctNDFjYy1iM2QyLWIyZTc0YTc1Mjg3ZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMFQxMjA4NTlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0yZmY3ZThjMTI4YjEzZGNjZTdmNGM5NTJkOGViMzM0NDBlZjYyOTdmYmY0ZWM3NWM1OTM2NjgyOGQ5NjFhM2MwJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.eYSFcE_PtFWOyk-N2B1aILuFSFFhpfMUTXAIVHbZ0sI)
If i change the size of the paper, the position of the halo is changed to a strange place.
![image](https://private-user-images.githubusercontent.com/188142734/388793625-d9319e08-1e6c-4007-91fd-d516f6df225a.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxODk2MzksIm5iZiI6MTczOTE4OTMzOSwicGF0aCI6Ii8xODgxNDI3MzQvMzg4NzkzNjI1LWQ5MzE5ZTA4LTFlNmMtNDAwNy05MWZkLWQ1MTZmNmRmMjI1YS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMFQxMjA4NTlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wMDI0OGNjNTllZjc0ZmJlMjhiZjZjNDNhNmMyNmRiNjQyNDhjMDk5MThlZWZmMjMwZmIzZTA3Y2Q4YjMxZjY0JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.vvd-efafoYUav7Kj9DiFy6WB7iZHwxNuZgUX8n3qAZY)
![image](https://private-user-images.githubusercontent.com/188142734/388793812-3391b20e-fd38-4ab2-9cc8-22b15ececb15.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxODk2MzksIm5iZiI6MTczOTE4OTMzOSwicGF0aCI6Ii8xODgxNDI3MzQvMzg4NzkzODEyLTMzOTFiMjBlLWZkMzgtNGFiMi05Y2M4LTIyYjE1ZWNlY2IxNS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMFQxMjA4NTlaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0zZGFmNjVlMTEwYTQ3ZjQ2NGRkOTVlZThhYTUwMDA3YTVjZThhZjZiMDlkYzU2YWVjYzM0NTE4MjczNGRhMzE2JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.AR-lcdYTEt3hCexhjxfmJyfKKEq3yGQdL8q_kWE2zJE)
What I want is that even if the screen scale changes, I want the halo to come out just above the click position of Link.
Thank you.
Steps to reproduce
No response
Restrictions & Constraints
No response
Does your question relate to JointJS or JointJS+. Select both if applicable.
JointJS+
Beta Was this translation helpful? Give feedback.
All reactions