Skip to content

Commit

Permalink
Fix overlay default position bug
Browse files Browse the repository at this point in the history
  • Loading branch information
SaifAqqad committed Jul 16, 2023
1 parent 3a069ed commit 9279c2b
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/UI/Overlay.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@
; position is not set -> use default position
if (!this.windowPosition)
this._setDefaultPos(display)
else {
else
this.currentPos := this.options.pos[1] := display.getRelativePosition(this.windowPosition.X, this.windowPosition.Y)
}
}
} else {
positionConfig := this.options.pos[1]
Expand All @@ -98,7 +97,7 @@
if (!display)
display := DisplayDevices.getByPosition(positionConfig.X, positionConfig.Y)

; display wasn't -> fallback to primary display
; display wasn't found -> fallback to primary display
if (!display)
display := DisplayDevices.getPrimary()

Expand All @@ -107,9 +106,8 @@
; position is not set -> use default position
if (!this.windowPosition)
this._setDefaultPos(display)
else {
else
this.currentPos := this.options.pos[1] := display.getRelativePosition(this.windowPosition.X, this.windowPosition.Y)
}
}
}

Expand Down Expand Up @@ -143,7 +141,7 @@
this.currentPos := this.options.pos[1] := Overlay.DEFAULT_POSITION.Clone()
this.options.pos[1].DisplayId := display.id

this.windowPosition := display.getAbsolutePosition(this.options.pos[1].X, this.options.pos[1].X)
this.windowPosition := display.getAbsolutePosition(this.options.pos[1].X, this.options.pos[1].Y)
}

_createWindow() {
Expand Down

0 comments on commit 9279c2b

Please sign in to comment.