final fixes on resolution and fix build issue on mac and linux
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user