Skip to content

Commit

Permalink
Fixed refactoring error
Browse files Browse the repository at this point in the history
  • Loading branch information
avahe-kellenberger committed Jul 3, 2022
1 parent 0138c36 commit ceea03f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/nimdowpkg/windowmanager.nim
Original file line number Diff line number Diff line change
Expand Up @@ -573,11 +573,14 @@ proc jumpToUrgentWindow(this: WindowManager) =
template modWidthDiff(this: WindowManager, diff: int) =
var layout = this.selectedMonitor.taggedClients.findFirstSelectedTag.layout
if layout of MasterStackLayout:
var masterStackLayout = cast[MasterStackLayout](layout)
let masterStackLayout = cast[MasterStackLayout](layout)
let screenWidth = masterStackLayout.calcScreenWidth(this.selectedMonitor.layoutOffset)
if (diff > 0 and masterStackLayout.widthDiff < 0) or (diff < 0 and masterStackLayout.widthDiff > 0):
let clientWidth = masterStackLayout.calcClientWidth(screenWidth).int
if clientWidth - abs(masterStackLayout.widthDiff).int - abs(diff).int > 0:

if
(diff > 0 and masterStackLayout.widthDiff < 0) or
(diff < 0 and masterStackLayout.widthDiff > 0) or
masterStackLayout.calcClientWidth(screenWidth).int - abs(masterStackLayout.widthDiff).int - abs(
diff).int > 0:
masterStackLayout.widthDiff += diff
this.selectedMonitor.doLayout()

Expand Down

0 comments on commit ceea03f

Please sign in to comment.