@@ -46,8 +46,8 @@ mpl.figure = function (figure_id, websocket, ondownload, parent_element) {
46
46
this . image_mode = 'full' ;
47
47
48
48
this . root = document . createElement ( 'div' ) ;
49
- this . _root_extra_style ( this . root ) ;
50
49
this . root . setAttribute ( 'style' , 'display: inline-block' ) ;
50
+ this . _root_extra_style ( this . root ) ;
51
51
52
52
parent_element . appendChild ( this . root ) ;
53
53
@@ -113,7 +113,9 @@ mpl.figure.prototype._init_canvas = function () {
113
113
canvas_div . setAttribute (
114
114
'style' ,
115
115
'border: 1px solid #ddd;' +
116
+ 'box-sizing: content-box;' +
116
117
'clear: both;' +
118
+ 'outline: 0;' +
117
119
'overflow: hidden;' +
118
120
'position: relative;' +
119
121
'resize: both;'
@@ -139,7 +141,7 @@ mpl.figure.prototype._init_canvas = function () {
139
141
140
142
var canvas = ( this . canvas = document . createElement ( 'canvas' ) ) ;
141
143
canvas . classList . add ( 'mpl-canvas' ) ;
142
- canvas . setAttribute ( 'style' , 'left: 0; top: 0; z-index: 0; outline: 0 ' ) ;
144
+ canvas . setAttribute ( 'style' , 'box-sizing: content-box; ' ) ;
143
145
144
146
this . context = canvas . getContext ( '2d' ) ;
145
147
@@ -159,7 +161,7 @@ mpl.figure.prototype._init_canvas = function () {
159
161
) ) ;
160
162
rubberband_canvas . setAttribute (
161
163
'style' ,
162
- 'position: absolute; left: 0; top: 0; z-index: 1;'
164
+ 'box-sizing: content-box; position: absolute; left: 0; top: 0; z-index: 1;'
163
165
) ;
164
166
165
167
var resizeObserver = new ResizeObserver ( function ( entries ) {
0 commit comments