跳转到内容

User:Bencmq/sandbox/0.js

维基百科,自由的百科全书

注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。

TreeDrawer.prototype.drawRight = function(node, parentX, parentY, layer) {
    var count, x, y;
    if (node.left === null) {
        count = 0;
    } else {
        count = 1 + this.shiftScaleCount(node.left);
    }
    x = parentX + tcon.distanceX + count * tcon.distanceX;
    y = parentY + tcon.distanceY;

    realDrawNode(node.data, node.data2, node.id, x, y, parentX, parentY, layer);

    if (node.left !== null) {
        this.drawLeft(node.left, x, y, layer);
    } else if (node.leftid != null) {
            backwardLeftEdge(x, y, nodelist[node.leftid].getX(), nodelist[node.leftid].getY(), layer);
            
    };
    if (node.right !== null) {
        this.drawRight(node.right, x, y, layer);
    } else if (node.rightid != null) {
            backwardRightEdge(x, y, nodelist[node.rightid].getX(), nodelist[node.rightid].getY(), layer);
            
    } else if (node.data2 === null) {
        var nullbox = new NodeEmpty_list(x, y);
        nullbox.put(layer);
    };
}