|
1 |
| -// flowchart, v1.1.2 |
| 1 | +// flowchart, v1.1.3 |
2 | 2 | // Copyright (c)2013 Adriano Raiano (adrai).
|
3 | 3 | // Distributed under MIT license
|
4 | 4 | // http://adrai.github.io/flowchart.js
|
|
111 | 111 | }
|
112 | 112 |
|
113 | 113 | function _inherits(ctor, superCtor) {
|
114 |
| - ctor.super_ = superCtor; |
115 |
| - ctor.prototype = Object.create(superCtor.prototype, { |
116 |
| - constructor: { |
117 |
| - value: ctor, |
118 |
| - enumerable: false, |
119 |
| - writable: true, |
120 |
| - configurable: true |
121 |
| - } |
122 |
| - }); |
| 114 | + if (typeof(Object.create) === 'function') { |
| 115 | + // implementation from standard node.js 'util' module |
| 116 | + ctor.super_ = superCtor; |
| 117 | + ctor.prototype = Object.create(superCtor.prototype, { |
| 118 | + constructor: { |
| 119 | + value: ctor, |
| 120 | + enumerable: false, |
| 121 | + writable: true, |
| 122 | + configurable: true |
| 123 | + } |
| 124 | + }); |
| 125 | + } else { |
| 126 | + // old school shim for old browsers |
| 127 | + ctor.super_ = superCtor; |
| 128 | + var TempCtor = function () {}; |
| 129 | + TempCtor.prototype = superCtor.prototype; |
| 130 | + ctor.prototype = new TempCtor(); |
| 131 | + ctor.prototype.constructor = ctor; |
| 132 | + } |
123 | 133 | }
|
124 | 134 |
|
125 | 135 | // move dependent functions to a container so that
|
|
866 | 876 | this.no_symbol.setY(rightPoint.y - this.no_symbol.height/2);
|
867 | 877 | this.no_symbol.shiftX(this.group.getBBox().x + this.width + this.chart.options['line-length']);
|
868 | 878 |
|
869 |
| - var hasSymbolUnder = false; |
870 |
| - var symb; |
871 |
| - for (var i = 0, len = this.chart.symbols.length; i < len; i++) { |
872 |
| - symb = this.chart.symbols[i]; |
873 |
| - |
874 |
| - var diff = Math.abs(symb.getCenter().x - this.no_symbol.getCenter().x); |
875 |
| - if (symb.getCenter().y > this.no_symbol.getCenter().y && diff <= this.no_symbol.width/2) { |
876 |
| - hasSymbolUnder = true; |
877 |
| - break; |
| 879 | + var self = this; |
| 880 | + (function shift() { |
| 881 | + var hasSymbolUnder = false; |
| 882 | + var symb; |
| 883 | + for (var i = 0, len = self.chart.symbols.length; i < len; i++) { |
| 884 | + symb = self.chart.symbols[i]; |
| 885 | + |
| 886 | + var diff = Math.abs(symb.getCenter().x - self.no_symbol.getCenter().x); |
| 887 | + if (symb.getCenter().y > self.no_symbol.getCenter().y && diff <= self.no_symbol.width/2) { |
| 888 | + hasSymbolUnder = true; |
| 889 | + break; |
| 890 | + } |
878 | 891 | }
|
879 |
| - } |
880 | 892 |
|
881 |
| - if (hasSymbolUnder) { |
882 |
| - this.no_symbol.setX(symb.getX() + symb.width + this.chart.options['line-length']); |
883 |
| - } |
| 893 | + if (hasSymbolUnder) { |
| 894 | + self.no_symbol.setX(symb.getX() + symb.width + self.chart.options['line-length']); |
| 895 | + shift(); |
| 896 | + } |
| 897 | + })(); |
884 | 898 |
|
885 | 899 | this.no_symbol.isPositioned = true;
|
886 | 900 |
|
|
0 commit comments