From e82ebb06b8931bd3e78d3c8c5b8fb737ffb9a02a Mon Sep 17 00:00:00 2001 From: John Bintz Date: Sat, 24 Mar 2012 08:57:42 -0400 Subject: [PATCH] get the export size right --- bin/attentive | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bin/attentive b/bin/attentive index bb29a0b..3085675 100755 --- a/bin/attentive +++ b/bin/attentive @@ -126,7 +126,15 @@ class Attentive::CLI < Thor browser.navigate.to "file://#{Dir.pwd}/_site/index.html" - browser.manage.window.resize_to 1024, 768 + target_width = 1024 + target_height = 768 + + browser.manage.window.resize_to target_width, target_height + + current_width = browser.execute_script('return window.innerWidth') + current_height = browser.execute_script('return window.innerHeight') + + browser.manage.window.resize_to target_width + (target_width - current_width), target_height + (target_height - current_height) get_current_slide = lambda { ((browser.execute_script('return document.location.href') || '')[%r{#(\d+)$}, 1] || -1).to_i }