mirror of
https://github.com/GNS3/gns3-web-ui.git
synced 2025-05-01 16:30:12 +00:00
18 lines
507 B
TypeScript
18 lines
507 B
TypeScript
import { Injectable } from "@angular/core";
|
|
import { Size } from "../models/size";
|
|
|
|
|
|
@Injectable()
|
|
export class CanvasSizeDetector {
|
|
public getOptimalSize(minWidth: number, minHeight: number) {
|
|
let width = document.documentElement.clientWidth;
|
|
let height = document.documentElement.clientHeight;
|
|
if (minWidth > width) {
|
|
width = minWidth;
|
|
}
|
|
if (minHeight > height) {
|
|
height = minHeight;
|
|
}
|
|
return new Size(width, height);
|
|
}
|
|
} |