From 937a0fc8d6cfe2bcaca8a1a6800204c3023937dc Mon Sep 17 00:00:00 2001 From: Ilya Shkolnik Date: Thu, 30 Jan 2020 17:33:50 +0300 Subject: [PATCH] Added public top and bottom panel paddings --- SwiftMonkey/Monkey.swift | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/SwiftMonkey/Monkey.swift b/SwiftMonkey/Monkey.swift index 574e480..86ce2f3 100644 --- a/SwiftMonkey/Monkey.swift +++ b/SwiftMonkey/Monkey.swift @@ -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 @@ -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) }