File tree 2 files changed +11
-0
lines changed
2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -102,8 +102,18 @@ module.exports = function draw(gd) {
102
102
var ly = gs . t + gs . h * ( 1 - opts . y ) - FROM_TL [ getYanchor ( opts ) ] * opts . _effHeight ;
103
103
104
104
if ( fullLayout . margin . autoexpand ) {
105
+ var lx0 = lx ;
106
+ var ly0 = ly ;
107
+
105
108
lx = Lib . constrain ( lx , 0 , fullLayout . width - opts . _width ) ;
106
109
ly = Lib . constrain ( ly , 0 , fullLayout . height - opts . _effHeight ) ;
110
+
111
+ if ( lx !== lx0 ) {
112
+ Lib . log ( 'Constrain legend.x to make legend fit inside graph' ) ;
113
+ }
114
+ if ( ly !== ly0 ) {
115
+ Lib . log ( 'Constrain legend.y to make legend fit inside graph' ) ;
116
+ }
107
117
}
108
118
109
119
// Set size and position of all the elements that make up a legend:
Original file line number Diff line number Diff line change @@ -945,6 +945,7 @@ describe('Test splom interactions:', function() {
945
945
946
946
it ( '@gl should clear graph and replot when canvas and WebGL context dimensions do not match' , function ( done ) {
947
947
var fig = Lib . extendDeep ( { } , require ( '@mocks/splom_iris.json' ) ) ;
948
+ fig . layout . showlegend = false ;
948
949
949
950
function assertDims ( msg , w , h ) {
950
951
var canvas = gd . _fullLayout . _glcanvas ;
You can’t perform that action at this time.
0 commit comments