From 9cc2ad1eaf941d8ed3b5542a3d5cdfccec7ba60b Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 19 Dec 2018 11:35:45 +1100 Subject: Fix invalid string comparisons Identity checks should never be used with strings, it may fail based on Python's interning logic. --- measureit/measureit_geometry.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'measureit') diff --git a/measureit/measureit_geometry.py b/measureit/measureit_geometry.py index 3b2e0186..e0b036d6 100644 --- a/measureit/measureit_geometry.py +++ b/measureit/measureit_geometry.py @@ -831,9 +831,9 @@ def draw_text(myobj, pos2d, display_text, rgb, fsize, align='L', text_rot=0.0): # ------------------- for line in mylines: text_width, text_height = blf.dimensions(font_id, line) - if align is 'C': + if align == 'C': newx = x_pos - text_width / 2 - elif align is 'R': + elif align == 'R': newx = x_pos - text_width - gap else: newx = x_pos @@ -851,7 +851,7 @@ def draw_text(myobj, pos2d, display_text, rgb, fsize, align='L', text_rot=0.0): if maxwidth < text_width: maxwidth = text_width - if align is 'L': + if align == 'L': blf.disable(font_id, ROTATION) return maxwidth, maxheight -- cgit v1.2.3