diff --git a/.bumpversion.toml b/.bumpversion.toml index c6e4ae2..aa6820b 100644 --- a/.bumpversion.toml +++ b/.bumpversion.toml @@ -1,5 +1,5 @@ [tool.bumpversion] -current_version = "1.1.0" +current_version = "1.1.1" parse = "(?P\\d+)\\.(?P\\d+)\\.(?P\\d+)" serialize = ["{major}.{minor}.{patch}"] search = "{current_version}" @@ -7,7 +7,7 @@ replace = "{new_version}" regex = false ignore_missing_version = false ignore_missing_files = false -tag = true +tag = false sign_tags = false tag_name = "v{new_version}" tag_message = "Bump version: {current_version} → {new_version}" diff --git a/CHANGELOG.md b/CHANGELOG.md index 7948a91..9cd3af9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file. --- +## [1.1.1] - 2025-12-11 + +### Fixed + +- Add a check for collapsed state. If collapsed use the default value `30` as height. + +--- + ## [1.1.0] - 2025-11-25 ### Added diff --git a/README.md b/README.md index 878ec46..44fe07f 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,7 @@ If issues persist, please open an issue with: ## Versioning & Releases +- **1.1.1** - Fixed collapsed state node links. - **1.1.0** - Added subway style and geometry awareness. - **1.0.2** - Fixed path method to patch each instance. - **1.0.1** - Fixed links lookup. diff --git a/__init__.py b/__init__.py index 220f986..9d3279a 100644 --- a/__init__.py +++ b/__init__.py @@ -8,7 +8,7 @@ __author__ = 'Edoardo Carmignani' __email__ = 'edoardo.carmignani@gmail.com' -__version__ = '1.1.0' +__version__ = '1.1.1' WEB_DIRECTORY = './web' diff --git a/pyproject.toml b/pyproject.toml index 7ce1f78..0bb8617 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "extralinks" -version = "1.1.0" +version = "1.1.1" description = "More connection links." authors = [ {name = "Edoardo Carmignani", email = "edoardo.carmignani@gmail.com"} diff --git a/web/js/ExtraLinks.js b/web/js/ExtraLinks.js index 436520b..c8fd547 100644 --- a/web/js/ExtraLinks.js +++ b/web/js/ExtraLinks.js @@ -50,7 +50,9 @@ const LinkRenderers = { path.lineTo(x2, y2); return; } - const sourceBottom = start_node.pos[1] + start_node.size[1]; + + const nodeHeight = start_node.collapsed ? start_node.height / 2 : start_node.size[1]; + const sourceBottom = start_node.collapsed ? start_node.pos[1] - (nodeHeight - offset) / 2 : nodeHeight + start_node.pos[1]; const sourceLeft = (start_node.pos[1] + start_node.size[1] < y2) ? start_node.pos[0] + start_node.size[0] : start_node.pos[0] + 10; const trayY = sourceBottom + ((slot_id + 1) * offset / 2); @@ -114,7 +116,8 @@ const LinkRenderers = { return; } - const sourceBottom = start_node.pos[1] + start_node.size[1]; + const nodeHeight = start_node.collapsed ? start_node.height / 2 : start_node.size[1]; + const sourceBottom = start_node.collapsed ? start_node.pos[1] - (nodeHeight - offset) / 2 : nodeHeight + start_node.pos[1]; const sourceLeft = (start_node.pos[1] + start_node.size[1] < y2) ? start_node.pos[0] + start_node.size[0] : start_node.pos[0] + 10; const trayY = sourceBottom + ((slot_id + 1) * offset / 2); @@ -184,9 +187,9 @@ const LinkRenderers = { pos[2] = Math.atan2(dy, dx); return; } - - const sourceBottom = start_node.pos[1] + start_node.size[1]; - const sourceLeft = (start_node.pos[1] + start_node.size[1] < y2) ? start_node.pos[0] + start_node.size[0]: start_node.pos[0] + 10; + const nodeHeight = start_node.collapsed ? start_node.height / 2 : start_node.size[1]; + const sourceBottom = start_node.collapsed ? start_node.pos[1] - (nodeHeight - offset) / 2 : nodeHeight + start_node.pos[1]; + const sourceLeft = (start_node.pos[1] + nodeHeight < y2) ? start_node.pos[0] + start_node.size[0]: start_node.pos[0] + 10; const trayY = sourceBottom + ((slot_id + 1) * offset / 2); let turnX2 = x2 - offset; @@ -254,6 +257,9 @@ export class ExtraLinks { const start_node = app.graph.getNodeById(full_link_object?.origin_id); const end_node = app.graph.getNodeById(full_link_object?.target_id); + console.log(start_node) + // console.log(end_node) + const is_dragging = (link2?.id == 'temp') || !app.graph.links[link2.id]; const startPos = link2.startPoint; diff --git a/web/js/extralinks_register.js b/web/js/extralinks_register.js index f1bd199..029f596 100644 --- a/web/js/extralinks_register.js +++ b/web/js/extralinks_register.js @@ -47,7 +47,7 @@ app.registerExtension({ }, { id: "Extra Links.ExtraLinks", - name: "Version 1.1.0", + name: "Version 1.1.1", type: () => { const container = document.createElement("span"); const btn = document.createElement("button");