Skip to content

Commit

Permalink
Merge pull request #17 from anteq/master
Browse files Browse the repository at this point in the history
Fix rounding error when calculating element width
  • Loading branch information
ZouYouShun authored Jan 11, 2019
2 parents 9247ef4 + 859ae3b commit d01066c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/ngx-hm-carousel.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ export class NgxHmCarouselComponent implements ControlValueAccessor, AfterViewIn
private hasInitWriteValue = false;

private get rootElmWidth() {
return (isPlatformBrowser(this.platformId) ? this.rootElm.clientWidth : 100);
return (isPlatformBrowser(this.platformId) ? this.rootElm.getBoundingClientRect().width : 100);
}

private set containerElmWidth(value) {
Expand Down

0 comments on commit d01066c

Please sign in to comment.