You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is just informationally. To use puzzleUnit.path, you have to flip the path vertically. Extension UIBezierPath:
func flipIt(vertically: Bool)
{
let rect = self.bounds
if vertically
{
self.apply(CGAffineTransform(translationX: 0, y: -rect.origin.y))
self.apply(CGAffineTransform(scaleX: 1, y: -1))
self.apply(CGAffineTransform(translationX: 0, y: rect.origin.y + rect.height))
}
else
{
//first, you need to move the view all the way to the left
//because otherwise, if you mirror it in its current position,
//the view will be thrown way off screen to the left
self.apply(CGAffineTransform(translationX: -rect.origin.x, y: 0))
//then you mirror it
self.apply(CGAffineTransform(scaleX: -1, y: 1))
//then, after its mirrored, move it back to its original position
self.apply(CGAffineTransform(translationX: rect.origin.x + rect.width, y: 0))
}
}
The text was updated successfully, but these errors were encountered:
This is just informationally. To use
puzzleUnit.path
, you have to flip the path vertically.Extension UIBezierPath
:The text was updated successfully, but these errors were encountered: