Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions dev/raphael.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -1140,20 +1140,35 @@ define(["eve"], function(eve) {
});
// PATHS
var paths = function (ps) {
// p is the cache
var p = paths.ps = paths.ps || {};
// q is the subset of cache items which have been used this tick
// (and so should not be expired from the cache)
var q = paths.q = paths.q || {};
if (p[ps]) {
p[ps].sleep = 100;
} else {
p[ps] = {
sleep: 100
};
}
setTimeout(function () {
for (var key in p) if (p[has](key) && key != ps) {
p[key].sleep--;
!p[key].sleep && delete p[key];
}
});
// if we've already queued a timeout, just mark this path as being
// used this tick, and increase the amount the lifetime of non-used
// items will be reduced by
if (paths.t) {
q[ps] = 1;
paths.t += 1;
} else {
setTimeout(function () {
for (var key in p) if (p[has](key) && !q[has](key)) {
p[key].sleep -= paths.t;
(p[key].sleep <= 0) && delete p[key];
}
paths.t = 0;
paths.q = {};
});
paths.t = 1;
}
return p[ps];
};
/*\
Expand Down
27 changes: 21 additions & 6 deletions raphael.js
Original file line number Diff line number Diff line change
Expand Up @@ -1215,20 +1215,35 @@ return /******/ (function(modules) { // webpackBootstrap
});
// PATHS
var paths = function (ps) {
// p is the cache
var p = paths.ps = paths.ps || {};
// q is the subset of cache items which have been used this tick
// (and so should not be expired from the cache)
var q = paths.q = paths.q || {};
if (p[ps]) {
p[ps].sleep = 100;
} else {
p[ps] = {
sleep: 100
};
}
setTimeout(function () {
for (var key in p) if (p[has](key) && key != ps) {
p[key].sleep--;
!p[key].sleep && delete p[key];
}
});
// if we've already queued a timeout, just mark this path as being
// used this tick, and increase the amount the lifetime of non-used
// items will be reduced by
if (paths.t) {
q[ps] = 1;
paths.t += 1;
} else {
setTimeout(function () {
for (var key in p) if (p[has](key) && !q[has](key)) {
p[key].sleep -= paths.t;
(p[key].sleep <= 0) && delete p[key];
}
paths.t = 0;
paths.q = {};
});
paths.t = 1;
}
return p[ps];
};
/*\
Expand Down
6 changes: 3 additions & 3 deletions raphael.min.js

Large diffs are not rendered by default.

27 changes: 21 additions & 6 deletions raphael.no-deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -1215,20 +1215,35 @@ return /******/ (function(modules) { // webpackBootstrap
});
// PATHS
var paths = function (ps) {
// p is the cache
var p = paths.ps = paths.ps || {};
// q is the subset of cache items which have been used this tick
// (and so should not be expired from the cache)
var q = paths.q = paths.q || {};
if (p[ps]) {
p[ps].sleep = 100;
} else {
p[ps] = {
sleep: 100
};
}
setTimeout(function () {
for (var key in p) if (p[has](key) && key != ps) {
p[key].sleep--;
!p[key].sleep && delete p[key];
}
});
// if we've already queued a timeout, just mark this path as being
// used this tick, and increase the amount the lifetime of non-used
// items will be reduced by
if (paths.t) {
q[ps] = 1;
paths.t += 1;
} else {
setTimeout(function () {
for (var key in p) if (p[has](key) && !q[has](key)) {
p[key].sleep -= paths.t;
(p[key].sleep <= 0) && delete p[key];
}
paths.t = 0;
paths.q = {};
});
paths.t = 1;
}
return p[ps];
};
/*\
Expand Down
6 changes: 3 additions & 3 deletions raphael.no-deps.min.js

Large diffs are not rendered by default.