Edge scroll, minor refactoring

This commit is contained in:
barsdeveloper
2023-02-08 22:15:37 +01:00
parent cb98b85084
commit 319f5af77f
20 changed files with 175 additions and 60 deletions

View File

@@ -3,6 +3,7 @@ import ElementFactory from "../../element/ElementFactory"
import IMouseClickDrag from "./IMouseClickDrag"
/**
* @typedef {import("../../Blueprint").default} Blueprint
* @typedef {import("../../element/LinkElement").default} LinkElement
* @typedef {import("../../element/LinkElement").LinkElementConstructor} LinkElementConstructor
* @typedef {import("../../element/PinElement").default} PinElement
@@ -68,6 +69,16 @@ export default class MouseCreateLink extends IMouseClickDrag {
linkValid = false
/**
* @param {PinElement} target
* @param {Blueprint} blueprint
* @param {Object} options
*/
constructor(target, blueprint, options = {}) {
options.scrollGraphEdge ??= true
super(target, blueprint, options)
}
startDrag(location) {
if (this.target.nodeElement.getType() == Configuration.nodeType.knot) {
this.#knotPin = this.target