From ff3660912a41b635d264f0694e31454f2214c44c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Tue, 18 Oct 2022 18:48:46 +0300 Subject: [PATCH] Fix minheight calculation --- cmd/client_server/client.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/client_server/client.go b/cmd/client_server/client.go index b4b78f6..d29148e 100644 --- a/cmd/client_server/client.go +++ b/cmd/client_server/client.go @@ -50,12 +50,12 @@ func constructPartnersRequestBody(ir *req_types.IncomingRequest) []byte { var imps []req_types.Imp - // WARN: uint and float multiplication may cause problems for _, tile := range ir.Tiles { + minheight := uint(math.Floor(float64(tile.Width) * tile.Ratio)) imps = append(imps, req_types.Imp{ Id: tile.Id, Minwidth: tile.Width, - Minheight: uint(math.Floor(float64(tile.Width * uint(tile.Ratio))))}) + Minheight: minheight}) } outReqBody.Id = *ir.Id