final fixes on resolution and fix build issue on mac and linux

This commit is contained in:
KingKDot
2026-03-17 15:17:01 -05:00
parent 9bb5b531b5
commit f8a9bcebbb
6 changed files with 119 additions and 18 deletions
@@ -227,7 +227,7 @@ func captureDisplayBitBlt(display int) (*image.RGBA, error) {
dstH = srcH
}
useStretch := dstW > 0 && dstH > 0 && (dstW < srcW || dstH < srcH) && !cursorCaptureEnabled.Load()
useStretch := dstW > 0 && dstH > 0 && (dstW < srcW || dstH < srcH)
capW := srcW
capH := srcH
if useStretch {
@@ -290,7 +290,11 @@ func captureDisplayBitBlt(display int) (*image.RGBA, error) {
}
bitDur := time.Since(bitStart)
cursorDrawn := false
if !useStretch {
if useStretch {
sx := float64(capW) / float64(srcW)
sy := float64(capH) / float64(srcH)
cursorDrawn = DrawCursorOnDCScaled(hdcMem, bounds, sx, sy)
} else {
cursorDrawn = DrawCursorOnDC(hdcMem, bounds)
}
@@ -544,6 +548,11 @@ func SetMaxResolution(maxH int) {
log.Printf("capture: max resolution set to %d", maxH)
}
func BypassResolutionCap() (restore func()) {
old := maxResHeight.Swap(-1)
return func() { maxResHeight.Store(old) }
}
func EffectiveScaleForInput() float64 {
bits := lastCapScale.Load()
if bits == 0 {