Skip to content

Commit

Permalink
fix(graph/fitView): add container width and height without config
Browse files Browse the repository at this point in the history
  • Loading branch information
songhn233 authored and Yanyan-Wang committed May 24, 2021
1 parent 7e469c5 commit c259222
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/pc/src/graph/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ export default class Graph extends AbstractGraph implements IGraph {
const { clientWidth, clientHeight } = container
const width: number = this.get('width') || clientWidth;
const height: number = this.get('height') || clientHeight;

if (!this.get('width') && !this.get('height')) {
this.set('width', clientWidth);
this.set('height', clientHeight);
}

const renderer: string = this.get('renderer');

let canvas;
Expand Down

0 comments on commit c259222

Please sign in to comment.