개정판 5062109d
issue #663: fix size text auto sorting
Change-Id: I115dc85be1813f8022774373fdc054ae351129d2
DTI_PID/DTI_PID/TextItemFactory.py | ||
---|---|---|
360 | 360 |
index += 1 |
361 | 361 |
|
362 | 362 |
if len(tokens) == 2: |
363 |
if float(tokens[0]) < float(tokens[1]):
|
|
363 |
if self.inch_to_number(tokens[0]) < self.inch_to_number(tokens[1]):
|
|
364 | 364 |
tokens[0], tokens[1] = tokens[1], tokens[0] |
365 | 365 |
return delimiter.join(tokens) |
366 | 366 |
|
367 |
def inch_to_number(self, inch_str): |
|
368 |
inchs = inch_str.replace('"', '').split('-') |
|
369 |
number = 0 |
|
370 |
for inch in inchs: |
|
371 |
if '/' not in inch: |
|
372 |
number += float(inch) |
|
373 |
else: |
|
374 |
fraction = inch.split('/') |
|
375 |
number += float(fraction[0]) / float(fraction[1]) |
|
376 |
|
|
377 |
return number |
|
378 |
|
|
367 | 379 |
''' |
368 | 380 |
@brief check if given text is tag no |
369 | 381 |
@author humkyung |
내보내기 Unified diff