mirror of
https://github.com/tenox7/wrp.git
synced 2024-11-25 13:30:51 +00:00
remove else to improve readability
This commit is contained in:
parent
3dddb70be0
commit
d6b33ad140
6
wrp.go
6
wrp.go
@ -331,11 +331,11 @@ func (w wrpReq) capture() {
|
|||||||
}
|
}
|
||||||
log.Printf("%s Landed on: %s, Height: %v\n", w.req.RemoteAddr, w.url, h)
|
log.Printf("%s Landed on: %s, Height: %v\n", w.req.RemoteAddr, w.url, h)
|
||||||
w.printPage(fmt.Sprintf("#%02X%02X%02X", r, g, b))
|
w.printPage(fmt.Sprintf("#%02X%02X%02X", r, g, b))
|
||||||
|
height := int64(float64(w.height) / w.scale)
|
||||||
if w.height == 0 && h > 0 {
|
if w.height == 0 && h > 0 {
|
||||||
chromedp.Run(ctx, emulation.SetDeviceMetricsOverride(int64(float64(w.width)/w.scale), h+30, w.scale, false))
|
height = h + 30
|
||||||
} else {
|
|
||||||
chromedp.Run(ctx, emulation.SetDeviceMetricsOverride(int64(float64(w.width)/w.scale), int64(float64(w.height)/w.scale), w.scale, false))
|
|
||||||
}
|
}
|
||||||
|
chromedp.Run(ctx, emulation.SetDeviceMetricsOverride(int64(float64(w.width)/w.scale), height, w.scale, false))
|
||||||
// Capture screenshot...
|
// Capture screenshot...
|
||||||
err = chromedp.Run(ctx, chromedp.CaptureScreenshot(&pngcap))
|
err = chromedp.Run(ctx, chromedp.CaptureScreenshot(&pngcap))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user