Skip to content

Commit

Permalink
edit for ipad
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyMaksimkin committed Apr 6, 2020
1 parent 1c13995 commit 58a0bea
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions MaterialShowcase/MaterialShowcase+Calculations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,16 @@ extension MaterialShowcase {
//Screen coordinates
let leftTopPoint = CGPoint(x: 0, y: 0)
let leftBottomPoint = CGPoint(x: 0, y: frame.size.height)
let rightTopPoint = CGPoint(x: frame.size.width, y: 0)
let rightBottomPoint = CGPoint(x: frame.size.width, y: frame.size.height)

let screenRadius = min(distance(leftTopPoint, targetCenter),
distance(leftBottomPoint, targetCenter))
let topDistance = max(distance(leftTopPoint, targetCenter),
distance(rightTopPoint, targetCenter))

let bottomDistance = max(distance(leftBottomPoint, targetCenter),
distance(rightBottomPoint, targetCenter))

let screenRadius = min(topDistance, bottomDistance)

return max(textRadius, targetRadius, additionalRadius, screenRadius)
}
Expand Down

0 comments on commit 58a0bea

Please sign in to comment.