From fad65f2f5d2166dd64b71686b7a4df4a032eb097 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 29 Sep 2018 19:53:18 +0900 Subject: [PATCH] graphics: Use the viewport size same as the framebuffer size Fixes #691 --- internal/graphics/framebuffer.go | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/internal/graphics/framebuffer.go b/internal/graphics/framebuffer.go index cba671744..dd0d4cd9a 100644 --- a/internal/graphics/framebuffer.go +++ b/internal/graphics/framebuffer.go @@ -16,7 +16,6 @@ package graphics import ( "github.com/hajimehoshi/ebiten/internal/opengl" - "github.com/hajimehoshi/ebiten/internal/web" ) // orthoProjectionMatrix returns an orthogonal projection matrix for OpenGL. @@ -68,15 +67,10 @@ func newScreenFramebuffer(width, height int) *framebuffer { // viewportSize returns the viewport size of the framebuffer. func (f *framebuffer) viewportSize() (int, int) { - // On some browsers, viewport size must be within the framebuffer size. - // e.g. Edge (#71), Chrome on GPD Pocket (#420) - if web.IsBrowser() { - return f.width, f.height - } - - // If possible, always use the same viewport size to reduce draw calls. - m := MaxImageSize() - return m, m + // On some environments, viewport size must be within the framebuffer size. + // e.g. Edge (#71), Chrome on GPD Pocket (#420), macOS Mojave (#691). + // Use the same size of the framebuffer here. + return f.width, f.height } // setAsViewport sets the framebuffer as the current viewport.