From 72f4f213d989af8aa0ff13b485d91f5d952876bc Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Thu, 12 Jul 2018 16:45:12 -0700 Subject: [PATCH] Compute the correct number of pixels to shave off of bar width --- ui/app/components/distribution-bar.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/app/components/distribution-bar.js b/ui/app/components/distribution-bar.js index 3cdaa7b2a..c02b217ff 100644 --- a/ui/app/components/distribution-bar.js +++ b/ui/app/components/distribution-bar.js @@ -117,7 +117,14 @@ export default Component.extend(WindowResizable, { this.set('slices', slices); - const setWidth = d => `${width * d.percent - (d.index === sliceCount - 1 || d.index === 0 ? 1 : 2)}px`; + const setWidth = d => { + // Remove a pixel from either side of the slice + let modifier = 2; + if (d.index === 0) modifier--; // But not the left side + if (d.index === sliceCount - 1) modifier--; // But not the right side + + return `${width * d.percent - modifier}px`; + }; const setOffset = d => `${width * d.offset + (d.index === 0 ? 0 : 1)}px`; let hoverTargets = slices.selectAll('.target').data(d => [d]);