mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
Made EvTable handle data entries with completely empty cells. Resolves #917.
This commit is contained in:
parent
0bf05a8795
commit
483263dda1
1 changed files with 4 additions and 4 deletions
|
|
@ -441,14 +441,14 @@ class EvCell(object):
|
|||
if "width" in kwargs:
|
||||
width = kwargs.pop("width")
|
||||
self.width = width - self.pad_left - self.pad_right - self.border_left - self.border_right
|
||||
if self.width <= 0:
|
||||
if self.width <= 0 and self.raw_width > 0:
|
||||
raise Exception("Cell width too small - no space for data.")
|
||||
else:
|
||||
self.width = self.raw_width
|
||||
if "height" in kwargs:
|
||||
height = kwargs.pop("height")
|
||||
self.height = height - self.pad_top - self.pad_bottom - self.border_top - self.border_bottom
|
||||
if self.height <= 0:
|
||||
if self.height <= 0 and self.raw_height > 0:
|
||||
raise Exception("Cell height too small - no space for data.")
|
||||
else:
|
||||
self.height = self.raw_height
|
||||
|
|
@ -789,12 +789,12 @@ class EvCell(object):
|
|||
if "width" in kwargs:
|
||||
width = kwargs.pop("width")
|
||||
self.width = width - self.pad_left - self.pad_right - self.border_left - self.border_right + self.trim_horizontal
|
||||
if self.width <= 0:
|
||||
if self.width <= 0 and self.raw_width > 0:
|
||||
raise Exception("Cell width too small, no room for data.")
|
||||
if "height" in kwargs:
|
||||
height = kwargs.pop("height")
|
||||
self.height = height - self.pad_top - self.pad_bottom - self.border_top - self.border_bottom + self.trim_vertical
|
||||
if self.height <= 0:
|
||||
if self.height <= 0 and self.raw_height > 0:
|
||||
raise Exception("Cell height too small, no room for data.")
|
||||
|
||||
# reformat (to new sizes, padding, header and borders)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue