@@ -133,21 +133,21 @@ function zoomNonClipped(geo, projection) {
133
133
function handleZoomstart ( ) {
134
134
d3 . select ( this ) . style ( zoomstartStyle ) ;
135
135
136
- var rect = this . getBoundingClientRect ( )
136
+ var rect = this . getBBox ( )
137
137
mouse0 = d3 . event . sourceEvent
138
138
? d3 . mouse ( this )
139
- : [ ( rect . left + rect . right ) / 2 , ( rect . bottom + rect . top ) / 2 ] ;
139
+ : [ rect . x + rect . width / 2 , rect . y + rect . height / 2 ] ;
140
140
rotate0 = projection . rotate ( ) ;
141
141
translate0 = projection . translate ( ) ;
142
142
lastRotate = rotate0 ;
143
143
zoomPoint = position ( mouse0 ) ;
144
144
}
145
145
146
146
function handleZoom ( ) {
147
- var rect = this . getBoundingClientRect ( )
147
+ var rect = this . getBBox ( )
148
148
mouse1 = d3 . event . sourceEvent
149
149
? d3 . mouse ( this )
150
- : [ ( rect . left + rect . right ) / 2 , ( rect . bottom + rect . top ) / 2 ] ;
150
+ : [ rect . x + rect . width / 2 , rect . y + rect . height / 2 ] ;
151
151
if ( outside ( mouse0 ) ) {
152
152
zoom . scale ( projection . scale ( ) ) ;
153
153
zoom . translate ( projection . translate ( ) ) ;
@@ -216,10 +216,10 @@ function zoomClipped(geo, projection) {
216
216
zoom . on ( 'zoomstart' , function ( ) {
217
217
d3 . select ( this ) . style ( zoomstartStyle ) ;
218
218
219
- var rect = this . getBoundingClientRect ( )
219
+ var rect = this . getBBox ( )
220
220
var mouse0 = d3 . event . sourceEvent
221
221
? d3 . mouse ( this )
222
- : [ ( rect . left + rect . right ) / 2 , ( rect . bottom + rect . top ) / 2 ] ;
222
+ : [ rect . x + rect . width / 2 , rect . y + rect . height / 2 ] ;
223
223
var rotate0 = projection . rotate ( ) ;
224
224
var lastRotate = rotate0 ;
225
225
var translate0 = projection . translate ( ) ;
@@ -228,10 +228,10 @@ function zoomClipped(geo, projection) {
228
228
zoomPoint = position ( projection , mouse0 ) ;
229
229
230
230
zoomOn . call ( zoom , 'zoom' , function ( ) {
231
- var rect = this . getBoundingClientRect ( )
231
+ var rect = this . getBBox ( )
232
232
var mouse1 = d3 . event . sourceEvent
233
233
? d3 . mouse ( this )
234
- : [ ( rect . left + rect . right ) / 2 , ( rect . bottom + rect . top ) / 2 ] ;
234
+ : [ rect . x + rect . width / 2 , rect . y + rect . height / 2 ] ;
235
235
236
236
projection . scale ( view . k = d3 . event . scale ) ;
237
237
0 commit comments