mirror of
https://github.com/barsdeveloper/ueblueprint.git
synced 2026-05-13 06:57:28 +08:00
Links implementation WIP
This commit is contained in:
5
dist/ueblueprint.js
vendored
5
dist/ueblueprint.js
vendored
@@ -399,6 +399,7 @@ class SelectorTemplate extends Template {
|
||||
*/
|
||||
apply(selector) {
|
||||
super.apply(selector);
|
||||
selector.classList.add("ueb-positioned");
|
||||
this.applyFinishSelecting(selector);
|
||||
}
|
||||
|
||||
@@ -1494,6 +1495,7 @@ class LinkTemplate extends Template {
|
||||
*/
|
||||
apply(link) {
|
||||
super.apply(link);
|
||||
link.classList.add("ueb-positioned");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1514,6 +1516,9 @@ class LinkTemplate extends Template {
|
||||
applyDestinationLocation(link, finalPosition) {
|
||||
link.style.setProperty("--ueb-to-x", sanitizeText(finalPosition[0]));
|
||||
link.style.setProperty("--ueb-to-y", sanitizeText(finalPosition[1]));
|
||||
const height = Math.abs(link.style.getPropertyValue("--ueb-from-y") - finalPosition[1]);
|
||||
let skew = Math.atan(height / (finalPosition[0] - link.style.getPropertyValue("--ueb-from-x"))) - Math.PI / 2;
|
||||
link.style.setProperty("--ueb-link-skew", skew);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user