Skip to content

Commit c11920a

Browse files
committed
Fixed rectangle/FitInside.
1 parent 63c4025 commit c11920a

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/geom/rectangle/FitInside.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ var FitInside = function (target, source)
2727
else
2828
{
2929
// Wider than Tall
30-
target.setSize(source.width, source.width * ratio);
30+
target.setSize(source.width, source.width / ratio);
3131
}
3232

3333
return target.setPosition(
34-
(source.right / 2) - (target.width / 2),
35-
(source.bottom / 2) - (target.height / 2)
34+
source.centerX - (target.width / 2),
35+
source.centerY - (target.height / 2)
3636
);
3737
};
3838

0 commit comments

Comments
 (0)