Skip to content

Commit d8e8c38

Browse files
committed
Honour the scrollbar margin
1 parent f781659 commit d8e8c38

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/components/legend/draw.js

+9-4
Original file line numberDiff line numberDiff line change
@@ -307,21 +307,26 @@ module.exports = function draw(gd) {
307307
return;
308308

309309
function positionScrollBar(legendHeight) {
310+
// increase the background and clip-path width
311+
// by the scrollbar width and margin
310312
bg.attr({
311313
width: opts.width -
312314
2 * opts.borderwidth +
313-
constants.scrollBarWidth
315+
constants.scrollBarWidth +
316+
constants.scrollBarMargin
314317
});
315318

316319
clipPath.select('rect').attr({
317-
width: opts.width + constants.scrollBarWidth
320+
width: opts.width +
321+
constants.scrollBarWidth +
322+
constants.scrollBarMargin
318323
});
319324

320325
if(gd.firstRender) {
321326
// Move scrollbar to starting position
322327
scrollBar.call(
323328
Drawing.setRect,
324-
opts.width - constants.scrollBarMargin,
329+
opts.width,
325330
constants.scrollBarMargin,
326331
constants.scrollBarWidth,
327332
constants.scrollBarHeight
@@ -373,7 +378,7 @@ module.exports = function draw(gd) {
373378
scrollBox.attr('transform', 'translate(0, ' + scrollBoxY + ')');
374379
scrollBar.call(
375380
Drawing.setRect,
376-
opts.width - constants.scrollBarMargin,
381+
opts.width,
377382
scrollBarY,
378383
constants.scrollBarWidth,
379384
constants.scrollBarHeight

0 commit comments

Comments
 (0)