return colors;
})(),
- snapEnds: function(from, to, steps) {
+ snapEnds: function(from, to, steps)
+ {
var f = from,
t = to;
f= isNaN(f) ? 0 : f;
t= isNaN(t) ? 0 : t;
- if (f == t) {
+ if (f == t || steps == 0) {
return {from: f, to: t, power: 0};
}
+
if (Math.abs(f) == Infinity || Math.abs(t) == Infinity) {
return {from: f, to: t, power: 0};
}
-
function round(a) {
return Math.abs(a - .5) < .25 ? ~~(a) + .5 : Math.round(a);
}
i = ends.power,
j = 0,
txtattr = { font: "11px Arial, sans-serif" },
- text = paper.set(),
+ text = paper.set(),
d;
d = (t - f) / steps;
x + addon,
Y,
(labels && labels[j++]) || (
- Math.round(label) == label ? Roo.util.Format.number(label) : (+Roo.util.Format.number(rnd,0))
+ Math.round(label) == label ? Roo.util.Format.number(label,0) : Roo.util.Format.number(label,rnd)
)
).attr(txtattr).attr({
"text-anchor": orientation - 1 ? "start" : "end"
txt = 0,
prev = 0;
+ //Roo.log([X,x,length, dx]); return;
while (X <= x + length) {
type != "-" && type != " " && (path = path.concat(["M", X + .5, y - (type == "+" ? dashsize : !!orientation * dashsize * 2), "l", 0, dashsize * 2 + 1]));
text.push(txt = paper.text(X, y + addon, (labels && labels[j++]) || (Math.round(label) == label ? label : +label.toFixed(rnd))).attr(txtattr));