summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--john.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/john.lua b/john.lua
index fa6bd08..82f309c 100644
--- a/john.lua
+++ b/john.lua
@@ -15,8 +15,15 @@ if monitors == nil or #monitors < 1 then
end
fb:ppm(fs.open("img/john.pnm","rb"))
-print("size!!",fb:get_size())
-local xoffs = 0
+local W,H = fb:get_size()
+
+local total_width = 0
+for ix,iname in ipairs(monitors) do
+ local mon = peripheral.wrap(iname)
+ total_width = total_width + (mon.getSize())
+end
+local leftover = total_width - W
+local xoffs = math.floor(leftover/2)
for ix,iname in ipairs(monitors) do
print("doing",ix,iname)