fix(nodes): force update clause in updateDimensions
This commit is contained in:
@@ -75,10 +75,12 @@ export default (state: State, getters: ComputedGetters): Actions => {
|
|||||||
|
|
||||||
if (node) {
|
if (node) {
|
||||||
const dimensions = getDimensions(update.nodeElement)
|
const dimensions = getDimensions(update.nodeElement)
|
||||||
|
|
||||||
const doUpdate = !!(
|
const doUpdate = !!(
|
||||||
dimensions.width &&
|
(dimensions.width &&
|
||||||
dimensions.height &&
|
dimensions.height &&
|
||||||
(node.dimensions.width !== dimensions.width || node.dimensions.height !== dimensions.height || update.forceUpdate)
|
(node.dimensions.width !== dimensions.width || node.dimensions.height !== dimensions.height)) ||
|
||||||
|
update.forceUpdate
|
||||||
)
|
)
|
||||||
|
|
||||||
node.handleBounds = {
|
node.handleBounds = {
|
||||||
@@ -319,7 +321,7 @@ export default (state: State, getters: ComputedGetters): Actions => {
|
|||||||
const applyEdgeChanges: Actions['applyEdgeChanges'] = (changes) => applyChanges(changes, state.edges)
|
const applyEdgeChanges: Actions['applyEdgeChanges'] = (changes) => applyChanges(changes, state.edges)
|
||||||
|
|
||||||
const setState: Actions['setState'] = (options) => {
|
const setState: Actions['setState'] = (options) => {
|
||||||
const skip = ['modelValue', 'nodes', 'edges', 'maxZoom', 'minZoom', 'translateExtent']
|
const skip = ['modelValue', 'nodes', 'edges', 'maxZoom', 'minZoom', 'translateExtent', 'hooks']
|
||||||
const opts = options instanceof Function ? options(state) : options
|
const opts = options instanceof Function ? options(state) : options
|
||||||
|
|
||||||
if (typeof opts.modelValue !== 'undefined') setElements(opts.modelValue, opts.nodeExtent ?? state.nodeExtent)
|
if (typeof opts.modelValue !== 'undefined') setElements(opts.modelValue, opts.nodeExtent ?? state.nodeExtent)
|
||||||
|
|||||||
Reference in New Issue
Block a user