Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Blankfield <vvv>2022-07-25 21:34:15 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-07-25 21:43:52 +0300
commita228560fcedb44811efae571a88c3dfc7985148c (patch)
tree09af29d09779bdeffc69329d87d997a82e610e1f
parent3ec8a60720da4b2b4ad6d40f26b6a1aa30791973 (diff)
Fix T83719: Node Wrangler: broken node outline when fast connecting
No need to subtract scroll bar widths as they are hidden by default in 2.80+.
-rw-r--r--node_wrangler.py33
1 files changed, 14 insertions, 19 deletions
diff --git a/node_wrangler.py b/node_wrangler.py
index 73696ddd..4525217d 100644
--- a/node_wrangler.py
+++ b/node_wrangler.py
@@ -820,8 +820,7 @@ def draw_circle_2d_filled(shader, mx, my, radius, colour=(1.0, 1.0, 1.0, 0.7)):
def draw_rounded_node_border(shader, node, radius=8, colour=(1.0, 1.0, 1.0, 0.7)):
- area_width = bpy.context.area.width - (16*dpifac()) - 1
- bottom_bar = (16*dpifac()) + 1
+ area_width = bpy.context.area.width
sides = 16
radius = radius*dpifac()
@@ -847,7 +846,7 @@ def draw_rounded_node_border(shader, node, radius=8, colour=(1.0, 1.0, 1.0, 0.7)
vertices = [(mx,my)]
for i in range(sides+1):
if (4<=i<=8):
- if my > bottom_bar and mx < area_width:
+ if mx < area_width:
cosine = radius * cos(i * 2 * pi / sides) + mx
sine = radius * sin(i * 2 * pi / sides) + my
vertices.append((cosine,sine))
@@ -861,7 +860,7 @@ def draw_rounded_node_border(shader, node, radius=8, colour=(1.0, 1.0, 1.0, 0.7)
vertices = [(mx,my)]
for i in range(sides+1):
if (0<=i<=4):
- if my > bottom_bar and mx < area_width:
+ if mx < area_width:
cosine = radius * cos(i * 2 * pi / sides) + mx
sine = radius * sin(i * 2 * pi / sides) + my
vertices.append((cosine,sine))
@@ -875,7 +874,7 @@ def draw_rounded_node_border(shader, node, radius=8, colour=(1.0, 1.0, 1.0, 0.7)
vertices = [(mx,my)]
for i in range(sides+1):
if (8<=i<=12):
- if my > bottom_bar and mx < area_width:
+ if mx < area_width:
cosine = radius * cos(i * 2 * pi / sides) + mx
sine = radius * sin(i * 2 * pi / sides) + my
vertices.append((cosine,sine))
@@ -889,7 +888,7 @@ def draw_rounded_node_border(shader, node, radius=8, colour=(1.0, 1.0, 1.0, 0.7)
vertices = [(mx,my)]
for i in range(sides+1):
if (12<=i<=16):
- if my > bottom_bar and mx < area_width:
+ if mx < area_width:
cosine = radius * cos(i * 2 * pi / sides) + mx
sine = radius * sin(i * 2 * pi / sides) + my
vertices.append((cosine,sine))
@@ -918,18 +917,15 @@ def draw_rounded_node_border(shader, node, radius=8, colour=(1.0, 1.0, 1.0, 0.7)
m2x, m2y = bpy.context.region.view2d.view_to_region(nlocx + ndimx, nlocy, clip=False)
m1x = min(m1x, area_width)
m2x = min(m2x, area_width)
- if m1y > bottom_bar and m2y > bottom_bar:
- vertices.extend([(m1x,m1y), (m2x,m1y),
- (m2x,m1y+radius), (m1x,m1y+radius)])
- indices.extend([(id_last, id_last+1, id_last+3),
- (id_last+3, id_last+1, id_last+2)])
- id_last += 4
+ vertices.extend([(m1x,m1y), (m2x,m1y),
+ (m2x,m1y+radius), (m1x,m1y+radius)])
+ indices.extend([(id_last, id_last+1, id_last+3),
+ (id_last+3, id_last+1, id_last+2)])
+ id_last += 4
# Right edge
m1x, m1y = bpy.context.region.view2d.view_to_region(nlocx + ndimx, nlocy, clip=False)
m2x, m2y = bpy.context.region.view2d.view_to_region(nlocx + ndimx, nlocy - ndimy, clip=False)
- m1y = max(m1y, bottom_bar)
- m2y = max(m2y, bottom_bar)
if m1x < area_width and m2x < area_width:
vertices.extend([(m1x,m2y), (m1x+radius,m2y),
(m1x+radius,m1y), (m1x,m1y)])
@@ -942,11 +938,10 @@ def draw_rounded_node_border(shader, node, radius=8, colour=(1.0, 1.0, 1.0, 0.7)
m2x, m2y = bpy.context.region.view2d.view_to_region(nlocx + ndimx, nlocy-ndimy, clip=False)
m1x = min(m1x, area_width)
m2x = min(m2x, area_width)
- if m1y > bottom_bar and m2y > bottom_bar:
- vertices.extend([(m1x,m2y), (m2x,m2y),
- (m2x,m1y-radius), (m1x,m1y-radius)])
- indices.extend([(id_last, id_last+1, id_last+3),
- (id_last+3, id_last+1, id_last+2)])
+ vertices.extend([(m1x,m2y), (m2x,m2y),
+ (m2x,m1y-radius), (m1x,m1y-radius)])
+ indices.extend([(id_last, id_last+1, id_last+3),
+ (id_last+3, id_last+1, id_last+2)])
# now draw all edges in one batch
if len(vertices) != 0: