feat: Added checkOverflow method tests

This commit is contained in:
Giacomo Ferlaino 2020-03-13 21:53:48 +01:00
parent afa67c729b
commit e0c4c6dd99
2 changed files with 46 additions and 3 deletions

View file

@ -62,7 +62,7 @@ export class Ng2FittextDirective
return Math.floor(fontSize / speed);
}
checkOverflow(parent: any, children: any) {
checkOverflow(parent: any, children: any): boolean {
const overflowX = children.scrollWidth - parent.clientWidth;
const overflowY = children.clientHeight - parent.clientHeight;
return overflowX > 1 || overflowY > 1;