MCPcopy Create free account
hub / github.com/antirez/freakwan / rows_needed

Method rows_needed

scroller.py:99–106  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

97 # Return the number of rows needed to display the current self.lines
98 # This number may be > self.rows.
99 def rows_needed(self):
100 needed = 0
101 for l in self.lines:
102 if isinstance(l,ImageFCI):
103 needed += int(self.get_image_padded_height(l.height)/self.font_height)
104 else:
105 needed += int((len(l)+(self.cols-1))/self.cols)
106 return needed
107
108 # When displaying images, we need to start from the row edge in order
109 # make mixes of images and text well aligned. So we pad the image

Callers 1

draw_textMethod · 0.95

Calls 1

Tested by

no test coverage detected