Skip to content

Commit 70e1e73

Browse files
committed
optimization
1 parent 99ca89e commit 70e1e73

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/textual/_compositor.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,19 +1187,16 @@ def _render_chops(
11871187

11881188
for region, clip, strips in renders:
11891189
render_region = intersection(region, clip)
1190+
render_x = render_region.x
1191+
first_cut, last_cut = render_region.column_span
11901192

11911193
for y, strip in zip(render_region.line_range, strips):
11921194
if not is_rendered_line(y):
11931195
continue
11941196

11951197
chops_line = chops[y]
1196-
1197-
first_cut, last_cut = render_region.column_span
11981198
final_cuts = [cut for cut in cuts[y] if (last_cut >= cut >= first_cut)]
1199-
1200-
render_x = render_region.x
1201-
relative_cuts = [cut - render_x for cut in final_cuts[1:]]
1202-
cut_strips = strip.divide(relative_cuts)
1199+
cut_strips = strip.divide([cut - render_x for cut in final_cuts[1:]])
12031200

12041201
# Since we are painting front to back, the first segments for a cut "wins"
12051202
get_chops_line = chops_line.get

0 commit comments

Comments
 (0)