From d6b33ad140ebdf5bd7c60e8810ff07efe0b43914 Mon Sep 17 00:00:00 2001 From: Antoni Sawicki Date: Mon, 26 Oct 2020 01:49:03 -0700 Subject: [PATCH] remove else to improve readability --- wrp.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wrp.go b/wrp.go index 6b3c9aa..e550d27 100644 --- a/wrp.go +++ b/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) w.printPage(fmt.Sprintf("#%02X%02X%02X", r, g, b)) + height := int64(float64(w.height) / w.scale) if w.height == 0 && h > 0 { - chromedp.Run(ctx, emulation.SetDeviceMetricsOverride(int64(float64(w.width)/w.scale), h+30, w.scale, false)) - } else { - chromedp.Run(ctx, emulation.SetDeviceMetricsOverride(int64(float64(w.width)/w.scale), int64(float64(w.height)/w.scale), w.scale, false)) + height = h + 30 } + chromedp.Run(ctx, emulation.SetDeviceMetricsOverride(int64(float64(w.width)/w.scale), height, w.scale, false)) // Capture screenshot... err = chromedp.Run(ctx, chromedp.CaptureScreenshot(&pngcap)) if err != nil {