Skip to content

Commit fbb03b1

Browse files
authored
Merge pull request #2 from handgull/canvas-spacing-improvements
Canvas spacing improvements
2 parents ac4892c + 1fe9aaf commit fbb03b1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib/ngx-flickering-grid.component.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ export class NgxFlickeringGridComponent implements AfterViewInit, OnDestroy {
145145

146146
setCanvasSize(): void {
147147
this.canvas.nativeElement.width =
148-
this.background.nativeElement.getBoundingClientRect().width + 50;
148+
this.background.nativeElement.getBoundingClientRect().width;
149149
this.canvas.nativeElement.height =
150-
this.background.nativeElement.getBoundingClientRect().height + 50;
150+
this.background.nativeElement.getBoundingClientRect().height;
151151

152152
this.setupCanvas();
153153

@@ -157,10 +157,10 @@ export class NgxFlickeringGridComponent implements AfterViewInit, OnDestroy {
157157
}
158158

159159
setupCanvas(): void {
160-
this.cols = Math.floor(
160+
this.cols = Math.ceil(
161161
this.canvas.nativeElement.width / (this.squareSize + this.gridGap)
162162
);
163-
this.rows = Math.floor(
163+
this.rows = Math.ceil(
164164
this.canvas.nativeElement.height / (this.squareSize + this.gridGap)
165165
);
166166

0 commit comments

Comments
 (0)