@@ -265,16 +265,16 @@ test("position, default center on window", function() {
265265 var el = $ ( '<div></div>' ) . dialog ( ) ;
266266 var dialog = el . dialog ( 'widget' ) ;
267267 var offset = dialog . offset ( ) ;
268- same ( offset . left , Math . floor ( $ ( window ) . width ( ) / 2 - dialog . outerWidth ( ) / 2 ) + $ ( window ) . scrollLeft ( ) ) ;
269- same ( offset . top , Math . floor ( $ ( window ) . height ( ) / 2 - dialog . outerHeight ( ) / 2 ) + $ ( window ) . scrollTop ( ) ) ;
268+ same ( offset . left , Math . round ( $ ( window ) . width ( ) / 2 - dialog . outerWidth ( ) / 2 ) + $ ( window ) . scrollLeft ( ) ) ;
269+ same ( offset . top , Math . round ( $ ( window ) . height ( ) / 2 - dialog . outerHeight ( ) / 2 ) + $ ( window ) . scrollTop ( ) ) ;
270270 el . remove ( ) ;
271271} ) ;
272272
273273test ( "position, top on window" , function ( ) {
274274 var el = $ ( '<div></div>' ) . dialog ( { position : "top" } ) ;
275275 var dialog = el . dialog ( 'widget' ) ;
276276 var offset = dialog . offset ( ) ;
277- same ( offset . left , Math . floor ( $ ( window ) . width ( ) / 2 - dialog . outerWidth ( ) / 2 ) + $ ( window ) . scrollLeft ( ) ) ;
277+ same ( offset . left , Math . round ( $ ( window ) . width ( ) / 2 - dialog . outerWidth ( ) / 2 ) + $ ( window ) . scrollLeft ( ) ) ;
278278 same ( offset . top , $ ( window ) . scrollTop ( ) ) ;
279279 el . remove ( ) ;
280280} ) ;
@@ -284,7 +284,7 @@ test("position, left on window", function() {
284284 var dialog = el . dialog ( 'widget' ) ;
285285 var offset = dialog . offset ( ) ;
286286 same ( offset . left , 0 ) ;
287- same ( offset . top , Math . floor ( $ ( window ) . height ( ) / 2 - dialog . outerHeight ( ) / 2 ) + $ ( window ) . scrollTop ( ) ) ;
287+ same ( offset . top , Math . round ( $ ( window ) . height ( ) / 2 - dialog . outerHeight ( ) / 2 ) + $ ( window ) . scrollTop ( ) ) ;
288288 el . remove ( ) ;
289289} ) ;
290290
0 commit comments