Skip to content

Stop Circle.resize from leaking label radius into options.size - #2534

Open
Steve0x2a wants to merge 2 commits into
visjs:masterfrom
Steve0x2a:fix/circle-resize-options-size
Open

Steve0x2a wants to merge 2 commits into
visjs:masterfrom
Steve0x2a:fix/circle-resize-options-size

Conversation

@Steve0x2a

Copy link
Copy Markdown

Circle.resize() was writing the label-derived radius onto the shared node options object (this.options.size = diameter / 2). Every shape is constructed with that same object, so after a node had rendered as a circle, switching nodes.shape to a label-outside shape (dot, star, square, …) sized the node from the leftover radius instead of the configured nodes.size.

Drop the write. Circle still autosizes to its label and now boxes from this.radius, which resize already sets.

Fixes #2516

Reported by @peter-villadsen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Circle shape writes its label-derived size into node.options.size, leaking into every shape selected afterwards

1 participant