Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Commit

Permalink
Added public top and bottom panel paddings
Browse files Browse the repository at this point in the history
  • Loading branch information
ILYA2606 committed Jan 30, 2020
1 parent 68f49bb commit 937a0fc
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 937a0fc

Please sign in to comment.