From 127a98ca618baee99f7e42396f9e94c91da527b6 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Tue, 6 Dec 2022 15:22:37 -0700 Subject: [PATCH] Add some context to the code to help future improvement in this area. --- internal/driver/glfw/canvas.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/driver/glfw/canvas.go b/internal/driver/glfw/canvas.go index 69f51396a0..abd911ab2b 100644 --- a/internal/driver/glfw/canvas.go +++ b/internal/driver/glfw/canvas.go @@ -105,6 +105,9 @@ func (c *glCanvas) PixelCoordinateForPosition(pos fyne.Position) (int, int) { } func (c *glCanvas) Resize(size fyne.Size) { + // This might not be the ideal solution, but it effectively avoid the first frame to be blurry due to the + // rounding of the size to the loower integer when scale == 1. It does not affect the other cases as far as we tested. + // This can easily be seen with fyne/cmd/hello and a scale == 1 as the text will happear blurry without the following line. nearestSize := fyne.NewSize(float32(math.Ceil(float64(size.Width))), float32(math.Ceil(float64(size.Height)))) c.Lock()