From 264ca49a438c9dbb538dc34b8a72177b5b766336 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 5 Dec 2017 03:13:40 +0900 Subject: [PATCH] graphics: Bug fix: revert viewport size for Edge --- internal/graphics/command.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/graphics/command.go b/internal/graphics/command.go index a4a059b56..ac32df5c6 100644 --- a/internal/graphics/command.go +++ b/internal/graphics/command.go @@ -409,8 +409,9 @@ func (c *newScreenFramebufferImageCommand) Exec(indexOffsetInBytes int) error { if c.height < 1 { return errors.New("graphics: height must be equal or more than 1.") } - w := emath.NextPowerOf2Int(c.width) - h := emath.NextPowerOf2Int(c.height) - c.result.framebuffer = newScreenFramebuffer(w, h, c.offsetX, c.offsetY) + // The (default) framebuffer size can't be converted to a power of 2. + // On browsers, c.width and c.height are used as viewport size and + // Edge can't treat a bigger viewport than the drawing area (#71). + c.result.framebuffer = newScreenFramebuffer(c.width, c.height, c.offsetX, c.offsetY) return nil }