| 248 | } |
| 249 | } |
| 250 | function cacher(f, scope, postprocessor) { |
| 251 | function newf() { |
| 252 | var arg = Array.prototype.slice.call(arguments, 0), |
| 253 | args = arg.join("\u2400"), |
| 254 | cache = newf.cache = newf.cache || {}, |
| 255 | count = newf.count = newf.count || []; |
| 256 | if (cache[has](args)) { |
| 257 | repush(count, args); |
| 258 | return postprocessor ? postprocessor(cache[args]) : cache[args]; |
| 259 | } |
| 260 | count.length >= 1e3 && delete cache[count.shift()]; |
| 261 | count.push(args); |
| 262 | cache[args] = f.apply(scope, arg); |
| 263 | return postprocessor ? postprocessor(cache[args]) : cache[args]; |
| 264 | } |
| 265 | return newf; |
| 266 | } |
| 267 | Snap._.cacher = cacher; |
| 268 | function angle(x1, y1, x2, y2, x3, y3) { |
| 269 | if (x3 == null) { |