From 06317022a6dcf6aaf727af893e367f6170ab5eda Mon Sep 17 00:00:00 2001 From: Antoni Sawicki Date: Tue, 4 Jun 2019 01:30:00 -0700 Subject: [PATCH] better scaling --- wrp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrp.go b/wrp.go index 5db9c5c..442399d 100644 --- a/wrp.go +++ b/wrp.go @@ -171,7 +171,7 @@ func capture(gourl string, w int64, h int64, s float64, co int, p int64, i bool, // Run ChromeDP Magic err := chromedp.Run(ctx, - emulation.SetDeviceMetricsOverride(w, h, s, false), + emulation.SetDeviceMetricsOverride(int64(float64(w)/s), int64(float64(h)/s), s, false), chromedp.Navigate(gourl), chromedp.Evaluate(fmt.Sprintf("window.scrollTo(0, %d);", p*int64(float64(h)*float64(0.9))), &res), chromedp.Sleep(time.Second*1),