Skip to content

Commit b8eb335

Browse files
committed
Ignore CurrentColorPalette, which can be stored in the canvas
Will be supported starting from JSROOT 5.3.0
1 parent c24548e commit b8eb335

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

scripts/JSRootPainter.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4758,17 +4758,16 @@
47584758
}
47594759

47604760
JSROOT.TPadPainter.prototype.CheckColors = function(can) {
4761-
if (!can || !can.fPrimitives) return;
4762-
4763-
for (var i = 0; i < can.fPrimitives.arr.length; ++i) {
4764-
var obj = can.fPrimitives.arr[i];
4765-
if (obj==null) continue;
4766-
if ((obj._typename=="TObjArray") && (obj.name == "ListOfColors")) {
4767-
JSROOT.Painter.adoptRootColors(obj);
4768-
can.fPrimitives.arr.splice(i,1);
4769-
can.fPrimitives.opt.splice(i,1);
4770-
return;
4771-
}
4761+
var lst = can ? can.fPrimitives : null;
4762+
if (!lst) return;
4763+
for (var i = 0; i < lst.arr.length; ++i) {
4764+
var obj = lst.arr[i];
4765+
if (!obj || (obj._typename!=="TObjArray")) continue;
4766+
if (obj.name == "ListOfColors") JSROOT.Painter.adoptRootColors(obj);
4767+
else if (obj.name != "CurrentColorPalette") continue;
4768+
lst.arr.splice(i,1);
4769+
lst.opt.splice(i,1);
4770+
i--;
47724771
}
47734772
}
47744773

0 commit comments

Comments
 (0)