mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
[v3 linux] correct minimum zoom
This commit is contained in:
parent
2171192934
commit
bd9f7deb98
3 changed files with 7 additions and 2 deletions
|
|
@ -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))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue