diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-12-19 03:35:45 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-12-19 03:35:45 +0300 |
commit | 9cc2ad1eaf941d8ed3b5542a3d5cdfccec7ba60b (patch) | |
tree | 43ea30ad9109c60886e523a3d7d38b6c9e2b2c23 /measureit/measureit_geometry.py | |
parent | fb75f259861bf3dcd82abfab8b10b83da947053e (diff) |
Fix invalid string comparisons
Identity checks should never be used with strings, it may fail based on
Python's interning logic.
Diffstat (limited to 'measureit/measureit_geometry.py')
-rw-r--r-- | measureit/measureit_geometry.py | 6 |
1 files changed, 3 insertions, 3 deletions
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 |