feat: Added checkOverflow method tests
This commit is contained in:
parent
afa67c729b
commit
e0c4c6dd99
2 changed files with 46 additions and 3 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue