Skip to content

Commit

Permalink
Merge pull request zalando#85 from ILYA2606/master
Browse files Browse the repository at this point in the history
Added public top and bottom panel paddings
  • Loading branch information
wojciechczerski authored Feb 4, 2020
2 parents 68f49bb + 937a0fc commit be8bc82
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions SwiftMonkey/Monkey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,10 @@ import XCTest
*/
public class Monkey {
public typealias ActionClosure = () -> Void


public var topPanelPadding: CGFloat = 20
public var bottomPanelPadding: CGFloat = 20

var r: Random
let frame: CGRect

Expand Down Expand Up @@ -278,9 +281,7 @@ public class Monkey {
that trigger a panel pull-out.
*/
public func randomPointAvoidingPanelAreas() -> CGPoint {
let topHeight: CGFloat = 20
let bottomHeight: CGFloat = 20
let frameWithoutTopAndBottom = CGRect(x: 0, y: topHeight, width: frame.width, height: frame.height - topHeight - bottomHeight)
let frameWithoutTopAndBottom = CGRect(x: 0, y: topPanelPadding, width: frame.width, height: frame.height - topPanelPadding - bottomPanelPadding)
return randomPoint(inRect: frameWithoutTopAndBottom)
}

Expand Down

0 comments on commit be8bc82

Please sign in to comment.