From a269cf378557688f4baa21eee1bcf9c825a780c0 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Sat, 23 Sep 2023 18:24:03 +0900 Subject: [PATCH] ebiten: remove (*Monitor).Bounds() Now the unit of Bounds is device-dependent pixels, and this is useless and Ebitengine API always treat device-independent pixels. Rather, this might confuse users. Until we find a good solution, let's remove Bounds() for v2.6. MonitorType itself is still useful to specify a monitor to show a window. --- examples/monitor/main.go | 2 +- monitor.go | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/examples/monitor/main.go b/examples/monitor/main.go index fb69a00fd..fd9d1504a 100644 --- a/examples/monitor/main.go +++ b/examples/monitor/main.go @@ -57,7 +57,7 @@ func (g *Game) Draw(screen *ebiten.Image) { lines = append(lines, "") for i, m := range g.monitors { - lines = append(lines, fmt.Sprintf("%d: %s %s", i, m.Name(), m.Bounds().String())) + lines = append(lines, fmt.Sprintf("%d: %s", i, m.Name())) } activeMonitor := ebiten.Monitor() diff --git a/monitor.go b/monitor.go index 49e6bf247..31a45a8a7 100644 --- a/monitor.go +++ b/monitor.go @@ -15,20 +15,12 @@ package ebiten import ( - "image" - "github.com/hajimehoshi/ebiten/v2/internal/ui" ) // MonitorType represents a monitor available to the system. type MonitorType ui.Monitor -// Bounds returns the position and size of the monitor in pixels. -// Be careful that the unit is not device-independent pixels. -func (m *MonitorType) Bounds() image.Rectangle { - return (*ui.Monitor)(m).Bounds() -} - // Name returns the monitor's name. On Linux, this reports the monitors in xrandr format. // On Windows, this reports "Generic PnP Monitor" for all monitors. func (m *MonitorType) Name() string {