Skip to content

Commit 0ff7a16

Browse files
committed
Resizable: Don't round dimensions
1 parent e19d462 commit 0ff7a16

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

ui/widgets/resizable.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ $.widget( "ui.resizable", $.ui.mouse, {
6868
},
6969

7070
_num: function( value ) {
71-
return parseInt( value, 10 ) || 0;
71+
return parseFloat( value ) || 0;
7272
},
7373

7474
_isNumber: function( value ) {
75-
return !isNaN( parseInt( value, 10 ) );
75+
return !isNaN( parseFloat( value ) );
7676
},
7777

7878
_hasScroll: function( el, a ) {
@@ -440,9 +440,9 @@ $.widget( "ui.resizable", $.ui.mouse, {
440440
width: ( that.helper.width() - soffsetw ),
441441
height: ( that.helper.height() - soffseth )
442442
};
443-
left = ( parseInt( that.element.css( "left" ), 10 ) +
443+
left = ( parseFloat( that.element.css( "left" ) ) +
444444
( that.position.left - that.originalPosition.left ) ) || null;
445-
top = ( parseInt( that.element.css( "top" ), 10 ) +
445+
top = ( parseFloat( that.element.css( "top" ) ) +
446446
( that.position.top - that.originalPosition.top ) ) || null;
447447

448448
if ( !o.animate ) {
@@ -640,8 +640,8 @@ $.widget( "ui.resizable", $.ui.mouse, {
640640
];
641641

642642
for ( ; i < 4; i++ ) {
643-
widths[ i ] = ( parseInt( borders[ i ], 10 ) || 0 );
644-
widths[ i ] += ( parseInt( paddings[ i ], 10 ) || 0 );
643+
widths[ i ] = ( parseFloat( borders[ i ] ) || 0 );
644+
widths[ i ] += ( parseFloat( paddings[ i ] ) || 0 );
645645
}
646646

647647
return {
@@ -776,9 +776,9 @@ $.ui.plugin.add( "resizable", "animate", {
776776
soffseth = ista && that._hasScroll( pr[ 0 ], "left" ) ? 0 : that.sizeDiff.height,
777777
soffsetw = ista ? 0 : that.sizeDiff.width,
778778
style = { width: ( that.size.width - soffsetw ), height: ( that.size.height - soffseth ) },
779-
left = ( parseInt( that.element.css( "left" ), 10 ) +
779+
left = ( parseFloat( that.element.css( "left" ) ) +
780780
( that.position.left - that.originalPosition.left ) ) || null,
781-
top = ( parseInt( that.element.css( "top" ), 10 ) +
781+
top = ( parseFloat( that.element.css( "top" ) ) +
782782
( that.position.top - that.originalPosition.top ) ) || null;
783783

784784
that.element.animate(
@@ -788,10 +788,10 @@ $.ui.plugin.add( "resizable", "animate", {
788788
step: function() {
789789

790790
var data = {
791-
width: parseInt( that.element.css( "width" ), 10 ),
792-
height: parseInt( that.element.css( "height" ), 10 ),
793-
top: parseInt( that.element.css( "top" ), 10 ),
794-
left: parseInt( that.element.css( "left" ), 10 )
791+
width: parseFloat( that.element.css( "width" ) ),
792+
height: parseFloat( that.element.css( "height" ) ),
793+
top: parseFloat( that.element.css( "top" ) ),
794+
left: parseFloat( that.element.css( "left" ) )
795795
};
796796

797797
if ( pr && pr.length ) {
@@ -999,8 +999,8 @@ $.ui.plugin.add( "resizable", "alsoResize", {
999999
$( o.alsoResize ).each( function() {
10001000
var el = $( this );
10011001
el.data( "ui-resizable-alsoresize", {
1002-
width: parseInt( el.width(), 10 ), height: parseInt( el.height(), 10 ),
1003-
left: parseInt( el.css( "left" ), 10 ), top: parseInt( el.css( "top" ), 10 )
1002+
width: parseFloat( el.width() ), height: parseFloat( el.height() ),
1003+
left: parseFloat( el.css( "left" ) ), top: parseFloat( el.css( "top" ) )
10041004
} );
10051005
} );
10061006
},

0 commit comments

Comments
 (0)