mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Fix comparisons between single elements and tuples of one element
This commit is contained in:
@@ -250,6 +250,11 @@ FLT_EPSILON = 2.0*1.19209290E-07
|
||||
|
||||
|
||||
def value_compare(ref, data, eps=FLT_EPSILON):
|
||||
# if we're comparing scalar to a 1-length tuple or list, compare against the first element. We only expect this for
|
||||
# data where it's possibly autogenerated
|
||||
if (type(data) == list or type(data) == tuple) and len(data) == 1 and type(data[0]) == type(ref):
|
||||
return value_compare(ref, data[0], eps)
|
||||
|
||||
if type(ref) == float or type(data) == float:
|
||||
# if the types are different this is probably 0.0 == 0 or something. Just compare straight by casting to floats
|
||||
if type(data) != type(data):
|
||||
|
||||
Reference in New Issue
Block a user