@@ -101,12 +101,12 @@ module.exports = function draw(gd) {
101
101
var thisImage = d3 . select ( this ) ;
102
102
103
103
// Axes if specified
104
- var xref = Axes . getFromId ( gd , d . xref ) ,
105
- yref = Axes . getFromId ( gd , d . yref ) ;
104
+ var xa = Axes . getFromId ( gd , d . xref ) ,
105
+ ya = Axes . getFromId ( gd , d . yref ) ;
106
106
107
107
var size = fullLayout . _size ,
108
- width = xref ? Math . abs ( xref . l2p ( d . sizex ) - xref . l2p ( 0 ) ) : d . sizex * size . w ,
109
- height = yref ? Math . abs ( yref . l2p ( d . sizey ) - yref . l2p ( 0 ) ) : d . sizey * size . h ;
108
+ width = xa ? Math . abs ( xa . l2p ( d . sizex ) - xa . l2p ( 0 ) ) : d . sizex * size . w ,
109
+ height = ya ? Math . abs ( ya . l2p ( d . sizey ) - ya . l2p ( 0 ) ) : d . sizey * size . h ;
110
110
111
111
// Offsets for anchor positioning
112
112
var xOffset = width * anchors . x [ d . xanchor ] . offset ,
@@ -115,8 +115,8 @@ module.exports = function draw(gd) {
115
115
var sizing = anchors . x [ d . xanchor ] . sizing + anchors . y [ d . yanchor ] . sizing ;
116
116
117
117
// Final positions
118
- var xPos = ( xref ? xref . l2p ( d . x ) + xref . _offset : d . x * size . w + size . l ) + xOffset ,
119
- yPos = ( yref ? yref . l2p ( d . y ) + yref . _offset : size . h - d . y * size . h + size . t ) + yOffset ;
118
+ var xPos = ( xa ? xa . l2p ( xa . r2l ( d . x ) ) + xa . _offset : d . x * size . w + size . l ) + xOffset ,
119
+ yPos = ( ya ? ya . l2p ( ya . r2l ( d . y ) ) + ya . _offset : size . h - d . y * size . h + size . t ) + yOffset ;
120
120
121
121
122
122
// Construct the proper aspectRatio attribute
@@ -141,8 +141,8 @@ module.exports = function draw(gd) {
141
141
142
142
143
143
// Set proper clipping on images
144
- var xId = xref ? xref . _id : '' ,
145
- yId = yref ? yref . _id : '' ,
144
+ var xId = xa ? xa . _id : '' ,
145
+ yId = ya ? ya . _id : '' ,
146
146
clipAxes = xId + yId ;
147
147
148
148
if ( clipAxes ) {
0 commit comments