# HG changeset patch # User Nicholas Jillings # Date 1506423102 -3600 # Node ID 91d923c51e90a866f8743a76a230551e23917da3 # Parent 4927dc84e86d93390d267582358c61d0467728c6 #78 Implemented for horizontal diff -r 4927dc84e86d -r 91d923c51e90 interfaces/horizontal-sliders.js --- a/interfaces/horizontal-sliders.js Tue Sep 26 11:49:49 2017 +0100 +++ b/interfaces/horizontal-sliders.js Tue Sep 26 11:51:42 2017 +0100 @@ -398,6 +398,14 @@ function drawScale() { var interfaceObj = testState.currentStateMap.interfaces[0]; var scales = testState.currentStateMap.interfaces[0].scales; + var ticks = specification.interfaces.options.concat(interfaceObj.options).find(function (a) { + return (a.type == "show" && a.name == "ticks"); + }); + if (ticks !== undefined) { + ticks = true; + } else { + ticks = false; + } scales = scales.sort(function (a, b) { return a.position - b.position; }); @@ -418,9 +426,11 @@ if (posPix >= width) { posPix = width - 1; } - ctx.moveTo(posPix, 0); - ctx.lineTo(posPix, height); - ctx.stroke(); + if (ticks) { + ctx.moveTo(posPix, 0); + ctx.lineTo(posPix, height); + ctx.stroke(); + } var text = document.createElement('div'); text.align = "center"; diff -r 4927dc84e86d -r 91d923c51e90 tests/examples/horizontal_example.xml --- a/tests/examples/horizontal_example.xml Tue Sep 26 11:49:49 2017 +0100 +++ b/tests/examples/horizontal_example.xml Tue Sep 26 11:51:42 2017 +0100 @@ -17,6 +17,7 @@ +