Skip to content

Commit

Permalink
Fix white corners around the focused view
Browse files Browse the repository at this point in the history
  • Loading branch information
pNre committed Aug 1, 2017
1 parent c9ce0eb commit 56fce70
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CoachMarks.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "CoachMarks"
s.version = "1.0.1"
s.version = "1.0.2"
s.summary = "CoachMarks is a component that can be used to focus the user attention on parts of the UI."

s.description = <<-DESC
Expand Down
10 changes: 8 additions & 2 deletions CoachMarks/CoachmarkView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -258,12 +258,18 @@ public class CoachmarkView: UIView {
self.textLabel.alpha = 1
}

if focusingOnElement, let snapshot = view.snapshot(of: rect, from: view) {
let dimension = sqrt(rect.width * rect.width + rect.height * rect.height)
let snapshotRect = CGRect(x: rect.origin.x + (rect.width - dimension) / 2.0,
y: rect.origin.y + (rect.height - dimension) / 2.0,
width: dimension,
height: dimension).integral.intersection(view.bounds)

if focusingOnElement, let snapshot = view.snapshot(of: snapshotRect, from: view) {

view.layoutIfNeeded()

snapshotView = UIImageView(image: snapshot)
snapshotView?.frame = rect
snapshotView?.frame = snapshotRect

innerCircle.isHidden = false
innerCircle.animatePath(withDuration: animationDuration, fromValue: 0.0)
Expand Down

0 comments on commit 56fce70

Please sign in to comment.