@@ -251,24 +251,24 @@ module.exports = function draw(gd) {
251
251
// If scrollbar should be shown.
252
252
if ( opts . height - legendHeight > 0 && ! gd . _context . staticPlot ) {
253
253
254
+ // increase the background and clip-path width
255
+ // by the scrollbar width and margin
254
256
bg . attr ( {
255
- width : opts . width - 2 * opts . borderwidth + constants . scrollBarWidth
257
+ width : opts . width -
258
+ 2 * opts . borderwidth +
259
+ constants . scrollBarWidth +
260
+ constants . scrollBarMargin
256
261
} ) ;
257
262
258
263
clipPath . select ( 'rect' ) . attr ( {
259
- width : opts . width + constants . scrollBarWidth
264
+ width : opts . width +
265
+ constants . scrollBarWidth +
266
+ constants . scrollBarMargin
260
267
} ) ;
261
268
262
269
if ( gd . firstRender ) {
263
270
// Move scrollbar to starting position
264
- scrollBar . call (
265
- Drawing . setRect ,
266
- opts . width - constants . scrollBarMargin ,
267
- constants . scrollBarMargin ,
268
- constants . scrollBarWidth ,
269
- constants . scrollBarHeight
270
- ) ;
271
- scrollBox . attr ( 'data-scroll' , 0 ) ;
271
+ scrollHandler ( constants . scrollBarMargin , 0 ) ;
272
272
}
273
273
274
274
var scrollBarYMax = legendHeight -
@@ -315,7 +315,7 @@ module.exports = function draw(gd) {
315
315
scrollBox . attr ( 'transform' , 'translate(0, ' + scrollBoxY + ')' ) ;
316
316
scrollBar . call (
317
317
Drawing . setRect ,
318
- opts . width - constants . scrollBarMargin ,
318
+ opts . width ,
319
319
scrollBarY ,
320
320
constants . scrollBarWidth ,
321
321
constants . scrollBarHeight
0 commit comments