Files
li 1b24994e74 feat: 后端全量更新 - 含所有本次需求
- Contract.php: 返回合约账户余额(balance_contract)
- My.php: 地址管理增加BTC/ETH
- AppContract.php: 一键平仓(closeall)
- AppProxy.php: 代理专属注册链接 + 分级权限(L1/L2)
- site.php: 手续费减半(0.018→0.009)
- agent_permission_setup.sql: 代理权限SQL
- crypto_news_crawler.py: 新闻自动采集脚本
2026-03-30 20:16:32 +08:00

84 lines
2.5 KiB
JavaScript
Executable File

"use strict";
/*
* Copyright (C) 1998-2020 by Northwoods Software Corporation. All Rights Reserved.
*/
// A custom Link whose routing is parallel to other links connecting the same pair of ports
/*
* This is an extension and not part of the main GoJS library.
* Note that the API for this class may change with any version, even point releases.
* If you intend to use an extension in production, you should copy the code to your own source directory.
* Extensions can be found in the GoJS kit under the extensions or extensionsTS folders.
* See the Extensions intro page (https://gojs.net/latest/intro/extensions.html) for more information.
*/
/**
* @constructor
* @extends Link
* @class
* This custom Link class customizes its route to go parallel to other links connecting the same ports,
* if the link is not orthogonal and is not Bezier curved.
*/
function ParallelRouteLink() {
go.Link.call(this);
}
go.Diagram.inherit(ParallelRouteLink, go.Link);
/**
* @this {ParallelRouteLink}
* @return {boolean}
*/
ParallelRouteLink.prototype.computePoints = function() {
var result = go.Link.prototype.computePoints.call(this);
if (!this.isOrthogonal && this.curve !== go.Link.Bezier && this.hasCurviness()) {
var curv = this.computeCurviness();
if (curv !== 0) {
var num = this.pointsCount;
var pidx = 0;
var qidx = num-1;
if (num >= 4) {
pidx++;
qidx--;
}
var frompt = this.getPoint(pidx);
var topt = this.getPoint(qidx);
var dx = topt.x - frompt.x;
var dy = topt.y - frompt.y;
var mx = frompt.x + dx * 1 / 8;
var my = frompt.y + dy * 1 / 8;
var px = mx;
var py = my;
if (-0.01 < dy && dy < 0.01) {
if (dx > 0) py -= curv; else py += curv;
} else {
var slope = -dx / dy;
var e = Math.sqrt(curv * curv / (slope * slope + 1));
if (curv < 0) e = -e;
px = (dy < 0 ? -1 : 1) * e + mx;
py = slope * (px - mx) + my;
}
mx = frompt.x + dx * 7 / 8;
my = frompt.y + dy * 7 / 8;
var qx = mx;
var qy = my;
if (-0.01 < dy && dy < 0.01) {
if (dx > 0) qy -= curv; else qy += curv;
} else {
var slope = -dx / dy;
var e = Math.sqrt(curv * curv / (slope * slope + 1));
if (curv < 0) e = -e;
qx = (dy < 0 ? -1 : 1) * e + mx;
qy = slope * (qx - mx) + my;
}
this.insertPointAt(pidx+1, px, py);
this.insertPointAt(qidx+1, qx, qy);
}
}
return result;
};