Custom table path, look and feel
-
I have a table where I'm drawing the path, and it looks like this:
How can I make it look like this?
-
This seems to work...
var p = Content.createPath(); p = obj.path; var index = p.toString().indexOf(parseInt(a[3]) + " z"); var s = p.toString().substring(0, index - 1); p.fromString(s);
-
Nah it fails when I invert the table :(
-
@d-healey try this
TBLLaf.registerFunction("drawTablePath", function(g, obj) { var p = Content.createPath(); p.clear(); var str = obj.path.toString(); var arr = []; if (str.contains("q")) { str = str.substring(0, str.lastIndexOf("l")); var arr = str.split(" "); } else { arr = str.split(" "); for (i = 0; i < 3; i++) arr.pop(); } arr[10] = arr[13]; str = arr.join(" "); p.fromString(str); g.setColour(Colours.withAlpha(Colours.cadetblue, 1)); g.drawPath(p, p.getBounds(1), 1.5); });