mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/ui: refactoring: remove redundant Monitor members
This commit is contained in:
parent
121d6005cd
commit
f72b8a4ced
@ -28,13 +28,11 @@ import (
|
||||
type Monitor struct {
|
||||
m *glfw.Monitor
|
||||
vm *glfw.VidMode
|
||||
// Pos of monitor in virtual coords
|
||||
x int
|
||||
y int
|
||||
width int
|
||||
height int
|
||||
id int
|
||||
name string
|
||||
|
||||
id int
|
||||
name string
|
||||
x int
|
||||
y int
|
||||
}
|
||||
|
||||
// Name returns the monitor's name.
|
||||
@ -91,16 +89,13 @@ func (m *monitors) update() {
|
||||
newMonitors := make([]*Monitor, 0, len(glfwMonitors))
|
||||
for i, m := range glfwMonitors {
|
||||
x, y := m.GetPos()
|
||||
vm := m.GetVideoMode()
|
||||
newMonitors = append(newMonitors, &Monitor{
|
||||
m: m,
|
||||
vm: m.GetVideoMode(),
|
||||
x: x,
|
||||
y: y,
|
||||
width: vm.Width,
|
||||
height: vm.Height,
|
||||
name: m.GetName(),
|
||||
id: i,
|
||||
m: m,
|
||||
vm: m.GetVideoMode(),
|
||||
id: i,
|
||||
name: m.GetName(),
|
||||
x: x,
|
||||
y: y,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -307,8 +307,8 @@ func (u *userInterfaceImpl) setWindowMonitor(monitor *Monitor) {
|
||||
w := u.dipToGLFWPixel(float64(ww), monitor.m)
|
||||
h := u.dipToGLFWPixel(float64(wh), monitor.m)
|
||||
x, y := monitor.x, monitor.y
|
||||
mw := u.dipFromGLFWMonitorPixel(float64(monitor.width), monitor.m)
|
||||
mh := u.dipFromGLFWMonitorPixel(float64(monitor.height), monitor.m)
|
||||
mw := u.dipFromGLFWMonitorPixel(float64(monitor.vm.Width), monitor.m)
|
||||
mh := u.dipFromGLFWMonitorPixel(float64(monitor.vm.Height), monitor.m)
|
||||
mw = u.dipToGLFWPixel(mw, monitor.m)
|
||||
mh = u.dipToGLFWPixel(mh, monitor.m)
|
||||
px, py := InitialWindowPosition(int(mw), int(mh), int(w), int(h))
|
||||
|
Loading…
Reference in New Issue
Block a user