Coding style
- Remove redundant casts since round function returns int in this case.
This commit is contained in:
parent
607653271b
commit
e54a07d038
1 changed files with 4 additions and 4 deletions
|
|
@ -59,8 +59,8 @@ def even_widths(column_widgets, width):
|
|||
column_count = len(column_widgets)
|
||||
widths = []
|
||||
for index, column_widget in enumerate(column_widgets):
|
||||
start_pos = int(round(float(width) / column_count * index))
|
||||
end_pos = int(round(float(width) / column_count * (index+1)))
|
||||
start_pos = round(float(width) / column_count * index)
|
||||
end_pos = round(float(width) / column_count * (index+1))
|
||||
widths.append(end_pos - start_pos)
|
||||
return widths
|
||||
|
||||
|
|
@ -101,8 +101,8 @@ def even_partition(row_widgets, height):
|
|||
row_count = len(row_widgets)
|
||||
heights = []
|
||||
for index, row_widget in enumerate(row_widgets):
|
||||
start_pos = int(round(float(height) / row_count * index))
|
||||
end_pos = int(round(float(height) / row_count * (index+1)))
|
||||
start_pos = round(float(height) / row_count * index)
|
||||
end_pos = round(float(height) / row_count * (index+1))
|
||||
heights.append(end_pos - start_pos)
|
||||
return heights
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue