Parcourir la source

chore: fix protocol issue with adf

v0lp3 il y a 4 ans
Parent
commit
e4eaacfd94
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  1. 6 1
      src/backend.go

+ 6 - 1
src/backend.go

@@ -62,8 +62,13 @@ func sendRequest(socket net.Conn, resolution int, _mode string, adf bool) (int,
 	width, height := 0, 0
 	planeWidth, planeHeight := 0, 0
 	dpiX, dpiY := 0, 0
+	adfStatus := 0
 
-	fmt.Sscanf(offer[3:], "%d,%d,2,%d,%d,%d,%d", &dpiX, &dpiY, &planeWidth, &width, &planeHeight, &height)
+	fmt.Sscanf(offer[3:], "%d,%d,%d,%d,%d,%d,%d", &dpiX, &dpiY, &adfStatus, &planeWidth, &width, &planeHeight, &height)
+
+	if planeHeight == 0 {
+		planeHeight = 294
+	}
 
 	width = mmToPixels(planeWidth, dpiX)
 	height = mmToPixels(planeHeight, dpiY)