Skip to content

Commit 65e3a76

Browse files
authored
Merge pull request #130 from vpython/bruce_fixes_nov_15_20
cannot copy object, need to copy attrs
2 parents 139924a + 3f05305 commit 65e3a76

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

vpython/cyvector.pyx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,9 @@ cpdef vector adjust_up(vector oldaxis, vector newaxis, vector up, vector save_ol
315315
return save_oldaxis
316316
if save_oldaxis is not None:
317317
# Restore saved oldaxis now that newaxis is nonzero
318-
oldaxis = save_oldaxis
318+
oldaxis._x = save_oldaxis._x # avoid creating a new vector
319+
oldaxis._y = save_oldaxis._y
320+
oldaxis._z = save_oldaxis._z
319321
save_oldaxis = None
320322
if newaxis.dot(up) != 0: # axis and up not orthogonal
321323
angle = oldaxis.diff_angle(newaxis)

0 commit comments

Comments
 (0)