Skip to content

Commit

Permalink
feat: use container's size when width or height was not specified
Browse files Browse the repository at this point in the history
  • Loading branch information
bubkoo committed Jul 16, 2020
1 parent ac48347 commit e94609c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/x6/src/graph/options.ts
Expand Up @@ -433,6 +433,17 @@ export namespace Options {
'mousewheel',
]

const container = options.container
if (container) {
if (others.width == null) {
others.width = container.clientWidth
}

if (others.height == null) {
others.height = container.clientHeight
}
}

const result = ObjectExt.merge({}, defaults, others) as Options.Definition

const defaultGrid: GridManager.CommonOptions = { size: 10, visible: false }
Expand Down

0 comments on commit e94609c

Please sign in to comment.