mirror of
https://github.com/tenox7/wrp.git
synced 2024-11-22 10:31:21 +00:00
better scaling
This commit is contained in:
parent
69d4b39eff
commit
06317022a6
2
wrp.go
2
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
|
// Run ChromeDP Magic
|
||||||
err := chromedp.Run(ctx,
|
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.Navigate(gourl),
|
||||||
chromedp.Evaluate(fmt.Sprintf("window.scrollTo(0, %d);", p*int64(float64(h)*float64(0.9))), &res),
|
chromedp.Evaluate(fmt.Sprintf("window.scrollTo(0, %d);", p*int64(float64(h)*float64(0.9))), &res),
|
||||||
chromedp.Sleep(time.Second*1),
|
chromedp.Sleep(time.Second*1),
|
||||||
|
Loading…
Reference in New Issue
Block a user