better scaling

This commit is contained in:
Antoni Sawicki 2019-06-04 01:30:00 -07:00
parent 69d4b39eff
commit 06317022a6

2
wrp.go
View File

@ -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),