[v3 linux] correct minimum zoom

This commit is contained in:
Travis McLane 2023-08-23 14:10:22 -05:00
commit bd9f7deb98
3 changed files with 7 additions and 2 deletions

View file

@ -765,6 +765,9 @@ func windowZoomOut(webview pointer) {
}
func windowZoomSet(webview pointer, zoom float64) {
if zoom < 1 { // 1.0 is the smallest allowable
zoom = 1
}
C.webkit_web_view_set_zoom_level((*C.WebKitWebView)(webview), C.double(zoom))
}

View file

@ -947,7 +947,6 @@ func windowZoom(webview pointer) float64 {
return webkitWebViewGetZoom(webview)
}
// FIXME: ZoomIn/Out is assumed to be incorrect!
func windowZoomIn(webview pointer) {
ZoomInFactor := 1.10
windowZoomSet(webview, windowZoom(webview)*ZoomInFactor)
@ -958,6 +957,9 @@ func windowZoomOut(webview pointer) {
}
func windowZoomSet(webview pointer, zoom float64) {
if zoom < 1.0 { // 1.0 is the smallest allowable
zoom = 1.0
}
webkitWebViewSetZoomLevel(webview, zoom)
}

View file

@ -210,7 +210,7 @@ func (w *linuxWebviewWindow) zoomOut() {
}
func (w *linuxWebviewWindow) zoomReset() {
windowZoomSet(w.webview, 0.0)
windowZoomSet(w.webview, 1.0)
}
func (w *linuxWebviewWindow) reload() {