Skip to main content
VertexCloneOptions
Options for the cloneVertex method.
NameTypeDescription
magnetize?booleanWhen the UI is in constant magnetize mode, the default behaviour - if you do not provide a newPosition - is to magnetize a newly cloned vertex, so that it moves to fit into whitespace. Without this, when the user drags a newly cloned vertex that is overlapping the vertex it was cloned from, the original vertex is magnetized out of the way, and the experience is a bit disconcerting for the user. When the UI is not in constant magnetize mode, the default is to not magnetize. Set this flag explicitly to get the behaviour you desire if the default doesnt suit.
newPosition?PointXYOptional position to use for the new vertex
offsetPosition?PointXYDefaults to 50 pixels in X and Y - the offset to use for the new vertex's position. Ignored if you provide newPosition.
selectAfterCreate?booleanIf true, the newly cloned vertex will be set as the model's current selection.