Skip to content

Commit f1b70af

Browse files
committed
Small fix in CIE diagram tool
1 parent df06e7d commit f1b70af

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools/cie_diagrams.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,10 @@ def get_spectral_locus_labels(opt):
122122

123123
diry = (y - y1) > 0
124124
dirx = (x - x1) > 0
125-
m1 = -((y - y1) / (x - x1)) ** -1
126-
m2 = -((y2 - y) / (x2 - x)) ** -1
125+
temp = (y - y1) / (x - x1)
126+
m1 = -(temp) ** -1 if temp else 0
127+
temp = (y2 - y) / (x2 - x)
128+
m2 = -(temp) ** -1 if temp else 0
127129
m = alg.lerp(m1, m2, factor)
128130

129131
length = math.sqrt(1.0 + m ** 2)

0 commit comments

Comments
 (0)