Skip to content

Commit

Permalink
Add some context to the code to help future improvement in this area.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cedric BAIL committed Dec 6, 2022
1 parent bde4e3d commit 127a98c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/driver/glfw/canvas.go
Expand Up @@ -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()
Expand Down

0 comments on commit 127a98c

Please sign in to comment.