Skip to content
Snippets Groups Projects
Commit 05f1d739 authored by mathias.chouet's avatar mathias.chouet
Browse files

Fix #464 - display bug when showing SectionParametree canvas in fullscreen mode

parent 22fc5001
No related branches found
No related tags found
No related merge requests found
Pipeline #138423 passed
......@@ -73,18 +73,17 @@ export class SectionCanvasComponent extends ResultsComponentDirective implements
@Input()
public set size(s: number) {
this._size = s;
console.log("(i) size set to", this._size);
}
// redessine le canvas chaque fois qu'une entrée change
public ngOnChanges() {
console.log("XXX section canvas on changes");
this.draw();
setTimeout(() => {
this.draw();
}, 10);
}
public ngAfterViewInit() { // wait for the view to init before using the element
this._context2d = this._calcCanvas.nativeElement.getContext("2d");
console.log("<<<< after view init >>>");
this.draw();
}
......@@ -113,7 +112,7 @@ export class SectionCanvasComponent extends ResultsComponentDirective implements
}
public draw() {
console.log(">> redrawing at size", this._size);
// console.log(">> redrawing at size", this._size);
if (this._context2d && this._section) {
this.reset();
......
......@@ -77,7 +77,6 @@ export class SectionResultsComponent extends ResultsComponentDirective {
private getContainerSize(useDefaultSize: boolean = false, useMinOfWidthAndHeight: boolean = false): number {
const container = this.element.nativeElement.querySelector(".section-results-container");
console.log("[container size in getContainerSize]", container.offsetWidth, container.offsetHeight);
let size: number;
if (container) {
if (useMinOfWidthAndHeight) {
......@@ -93,11 +92,14 @@ export class SectionResultsComponent extends ResultsComponentDirective {
// when going back from fullscreen mode, container size tends to be
// too high for whatever reason; use defaultSize on this purpose
if (useDefaultSize) {
console.log("~~ use default ~~", size, this.defaultSize);
size = this.defaultSize;
}
// lower boundary
size = Math.max(size, this.minimalSize);
// remove 10% in "fullscreen" mode
if (size > this.minimalSize) {
size = Math.max(size * 0.9, this.minimalSize);
}
return size;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment