-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* curve arrow * fix CR issue and compile error * fix rendering bag related with ppi --------- Co-authored-by: Denis Morozov <kramig@yandex-team.ru>
- Loading branch information
Showing
5 changed files
with
122 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// CurveInArrowShape.swift | ||
// | ||
// Created by Denis S. Morozov on 09/05/2023. | ||
// Copyright © 2023 Quassum Manus. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
public struct CurveInArrowShape: Shape { | ||
public func path(in rect: CGRect) -> Path { | ||
var path = Path() | ||
path.move(to: CGPoint(x: 0, y: rect.height)) | ||
path.addQuadCurve( | ||
to: CGPoint(x: rect.width / 2, y: 0), | ||
control: CGPoint(x: rect.width * 0.4, y: rect.height) | ||
) | ||
path.addQuadCurve( | ||
to: CGPoint(x: rect.width, y: rect.height), | ||
control: CGPoint(x: rect.width * 0.6, y: rect.height) | ||
) | ||
return path | ||
} | ||
} | ||
|
||
struct CurveInArrowShape_Preview: PreviewProvider { | ||
static var previews: some View { | ||
CurveInArrowShape().stroke() | ||
} | ||
} |