save peak meter window size

This commit is contained in:
Drew Weymouth
2024-07-22 19:04:59 -07:00
parent 9d0b381572
commit 4d635d88b9
4 changed files with 30 additions and 5 deletions
+7
View File
@@ -257,6 +257,13 @@ func NewTrailingAlignLabel() *widget.Label {
return rt
}
func SaveWindowSize(w fyne.Window, wPtr, hPtr *int) {
// round sizes to even to avoid Wayland issues with 2x scaling factor
// https://github.com/dweymouth/supersonic/issues/212
*wPtr = int(math.RoundToEven(float64(w.Canvas().Size().Width)))
*hPtr = int(math.RoundToEven(float64(w.Canvas().Size().Height)))
}
type HSpace struct {
widget.BaseWidget