From ce49f6cf2a561b5477cdfdf071447352e0eb77f9 Mon Sep 17 00:00:00 2001 From: Anthony Cook Date: Sat, 7 Oct 2023 23:36:08 -0500 Subject: [PATCH] Use memoized Frame compilation instead of regenerating --- lib/remedy/screen.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/remedy/screen.rb b/lib/remedy/screen.rb index 57b96ce..91bb7bf 100644 --- a/lib/remedy/screen.rb +++ b/lib/remedy/screen.rb @@ -85,7 +85,8 @@ def refresh_buffer def populate_buffer frames.sort_by(&:depth).each do |frame| frame.available_size = buffer.size - fsize = frame.compiled_size + content = frame.compile_contents + fsize = frame.computed_size case frame.vorigin when :top @@ -112,7 +113,7 @@ def populate_buffer voffset += frame.offset.height hoffset += frame.offset.width - buffer[voffset,hoffset] = frame + buffer[voffset,hoffset] = content end end end