Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! fixup! Disable canvastable dopaint
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowbas authored and bas080 committed Jan 28, 2025
1 parent c9b395f commit 6eb5a01
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/app/canvastable/canvastable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export namespace CanvasTable {
moduleId: 'angular2/app/canvastable/',
templateUrl: 'canvastable.component.html'
})
export class CanvasTableComponent implements AfterViewInit, DoCheck, OnInit {
export class CanvasTableComponent implements AfterViewInit, OnInit {
static incrementalId = 1;
public elementId: string;
private _topindex = 0.0;
Expand Down Expand Up @@ -223,18 +223,19 @@ export class CanvasTableComponent implements AfterViewInit, DoCheck, OnInit {
constructor(elementRef: ElementRef) {
}

ngDoCheck() {
if (this.canv) {
// No need to track changes.
// ngDoCheck() {
// if (this.canv) {

const devicePixelRatio = window.devicePixelRatio ? window.devicePixelRatio : 1;
this.wantedCanvasWidth = this.canv.parentElement.parentElement.clientWidth * devicePixelRatio;
this.wantedCanvasHeight = this.canv.parentElement.parentElement.clientHeight * devicePixelRatio;
// const devicePixelRatio = window.devicePixelRatio ? window.devicePixelRatio : 1;
// this.wantedCanvasWidth = this.canv.parentElement.parentElement.clientWidth * devicePixelRatio;
// this.wantedCanvasHeight = this.canv.parentElement.parentElement.clientHeight * devicePixelRatio;

if (this.canv.width !== this.wantedCanvasWidth || this.canv.height !== this.wantedCanvasHeight) {
this.hasChanges = true;
}
}
}
// if (this.canv.width !== this.wantedCanvasWidth || this.canv.height !== this.wantedCanvasHeight) {
// this.hasChanges = true;
// }
// }
// }

private calculateColumnWidths(columns: CanvasTableColumn[]) {
const colWidthSet = columns.map((col) => col.name).filter((cname) => cname.length > 0).join(',');
Expand Down

0 comments on commit 6eb5a01

Please sign in to comment.