Skip to content

Commit

Permalink
Fixed sixths & ninths calculations on the right side of the screen th…
Browse files Browse the repository at this point in the history
…at were off by a pixel.
  • Loading branch information
rxhanson committed Jun 4, 2024
1 parent 8074ce6 commit a886dda
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Rectangle/WindowCalculation/BottomRightNinthCalculation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class BottomRightNinthCalculation: WindowCalculation, OrientationAware, NinthsRe
rect.size.width = floor(visibleFrameOfScreen.width / 3.0)
rect.size.height = floor(visibleFrameOfScreen.height / 3.0)
rect.origin.y = visibleFrameOfScreen.minY
rect.origin.x = visibleFrameOfScreen.minX + (2.0 * rect.width)
rect.origin.x = visibleFrameOfScreen.minX + visibleFrameOfScreen.width - rect.width
return RectResult(rect, subAction: .bottomRightNinth)
}

Expand All @@ -45,7 +45,7 @@ class BottomRightNinthCalculation: WindowCalculation, OrientationAware, NinthsRe
rect.size.width = floor(visibleFrameOfScreen.width / 3.0)
rect.size.height = floor(visibleFrameOfScreen.height / 3.0)
rect.origin.y = visibleFrameOfScreen.minY
rect.origin.x = visibleFrameOfScreen.minX + (2.0 * rect.width)
rect.origin.x = visibleFrameOfScreen.minX + visibleFrameOfScreen.width - rect.width
return RectResult(rect, subAction: .bottomRightNinth)
}
}
Expand Down
4 changes: 2 additions & 2 deletions Rectangle/WindowCalculation/BottomRightSixthCalculation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ class BottomRightSixthCalculation: WindowCalculation, OrientationAware, SixthsRe
var rect = visibleFrameOfScreen
rect.size.width = floor(visibleFrameOfScreen.width / 3.0)
rect.size.height = floor(visibleFrameOfScreen.height / 2.0)
rect.origin.x = visibleFrameOfScreen.origin.x + (rect.width * 2)
rect.origin.x = visibleFrameOfScreen.origin.x + visibleFrameOfScreen.width - rect.width
return RectResult(rect, subAction: .bottomRightSixthLandscape)
}

func portraitRect(_ visibleFrameOfScreen: CGRect) -> RectResult {
var rect = visibleFrameOfScreen
rect.size.width = floor(visibleFrameOfScreen.width / 2.0)
rect.size.height = floor(visibleFrameOfScreen.height / 3.0)
rect.origin.x = visibleFrameOfScreen.origin.x + (rect.width * 2)
rect.origin.x = visibleFrameOfScreen.origin.x + visibleFrameOfScreen.width - rect.width
return RectResult(rect, subAction: .bottomRightSixthPortrait)
}
}
4 changes: 2 additions & 2 deletions Rectangle/WindowCalculation/MiddleRightNinthCalculation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class MiddleRightNinthCalculation: WindowCalculation, OrientationAware, NinthsRe
rect.size.width = floor(visibleFrameOfScreen.width / 3.0)
rect.size.height = floor(visibleFrameOfScreen.height / 3.0)
rect.origin.y = visibleFrameOfScreen.minY + rect.height
rect.origin.x = visibleFrameOfScreen.minX + (2.0 * rect.width)
rect.origin.x = visibleFrameOfScreen.minX + visibleFrameOfScreen.width - rect.width
return RectResult(rect, subAction: .middleRightNinth)
}

Expand All @@ -45,7 +45,7 @@ class MiddleRightNinthCalculation: WindowCalculation, OrientationAware, NinthsRe
rect.size.width = floor(visibleFrameOfScreen.width / 3.0)
rect.size.height = floor(visibleFrameOfScreen.height / 3.0)
rect.origin.y = visibleFrameOfScreen.minY + rect.height
rect.origin.x = visibleFrameOfScreen.minX + (2.0 * rect.width)
rect.origin.x = visibleFrameOfScreen.minX + visibleFrameOfScreen.width - rect.width
return RectResult(rect, subAction: .middleRightNinth)
}
}
Expand Down
4 changes: 2 additions & 2 deletions Rectangle/WindowCalculation/TopRightNinthCalculation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TopRightNinthCalculation: WindowCalculation, OrientationAware, NinthsRepea
rect.size.width = floor(visibleFrameOfScreen.width / 3.0)
rect.size.height = floor(visibleFrameOfScreen.height / 3.0)
rect.origin.y = visibleFrameOfScreen.maxY - rect.height
rect.origin.x = visibleFrameOfScreen.minX + (2.0 * rect.width)
rect.origin.x = visibleFrameOfScreen.minX + visibleFrameOfScreen.width - rect.width
return RectResult(rect, subAction: .topRightNinth)
}

Expand All @@ -45,7 +45,7 @@ class TopRightNinthCalculation: WindowCalculation, OrientationAware, NinthsRepea
rect.size.width = floor(visibleFrameOfScreen.width / 3.0)
rect.size.height = floor(visibleFrameOfScreen.height / 3.0)
rect.origin.y = visibleFrameOfScreen.maxY - rect.height
rect.origin.x = visibleFrameOfScreen.minX + (2.0 * rect.width)
rect.origin.x = visibleFrameOfScreen.minX + visibleFrameOfScreen.width - rect.width
return RectResult(rect, subAction: .topRightNinth)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Rectangle/WindowCalculation/TopRightSixthCalculation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class TopRightSixthCalculation: WindowCalculation, OrientationAware, SixthsRepea
var rect = visibleFrameOfScreen
rect.size.width = floor(visibleFrameOfScreen.width / 3.0)
rect.size.height = floor(visibleFrameOfScreen.height / 2.0)
rect.origin.x = visibleFrameOfScreen.minX + (rect.width * 2.0)
rect.origin.x = visibleFrameOfScreen.minX + visibleFrameOfScreen.width - rect.width
rect.origin.y = visibleFrameOfScreen.maxY - rect.height
return RectResult(rect, subAction: .topRightSixthLandscape)
}
Expand Down

0 comments on commit a886dda

Please sign in to comment.