Commit cb8e135
authored
Update for 0.6.0 release (#4)
* Updated documentation
* Added .relative to RectAnchor, deprecated edgeAnchors and vertexAchnors and added vertices
CGRect point and points methods were all deprecated and replaced with subscripts that take RectAnchor.
Added CGRect subscript that takes a RectAnchor and CornerStyle and returns a Corner.
Added CGRect subscript that takes an array of (x: CGFloat, y: CGFloat) tuples containing relative locations and returns points.
All references ro rect.point or rect.points were replaced with subscripts.
Associated parameter label radius was removed from CornerStyle values to reduce verbose noise. Deprecated versions that continue to use the named radius parameter were added and deprecated to ease transition.
All reference to CornerStyle radius associated parameter have had it removed to reduce verbose noise.
Bugfix: the .corner method was changed so if nil is provided and the type is already a corner it will not replace the corner style.
Added .interior and .exterior types to AnchorType
Updated documentation on Vector2 to mention CGVector
RelativeCornerShape file with unused concept was removed
* Removed CGRect subscripts that included cornerstyles
Added repositioned(to:) moved(:) and moved(dx:dy:) to CGRect
Added rect(origin:) and rect(x:y:) to CGSize
Added corner parameter to Vector2Representable that would keep existing corner or turn into a point style corner.
Added corners parameter to arrays of Vector2Representable that would do the same to an array.
Added rect(size:anchor:) and rect(width:height:anchor:) to CGPoint to easily create new rectangles
* Changed EnumeratedCornerShape styles dictionary value type from CornerStyle? to CornerStyle
Added bounds to Collection of Vector2Representable instead of just Array
Deprecated anchorPoint function on Array of Vector2Representable as bounds[anchor] can be used instead
Added relative(to:) to Vector2Representable to return a RectAnchor.
Added relative(to:) to Array of Vector2Representable to return an Array of RectAnchor.
Added rect(size:anchor:) and rect(width:height:anchor:) to Vector2Representable to return a CGRect.
Removed rect(size:anchor:) and rect(width:height:) from CGPoint as it's now in Vector2Transformable.
Added scaledPosition(:anchor:) to Vector2Transformable so that objects can be scaled based on a specific point.
Deprecated scaledPosition(scale:) on Vector2Transformable as scaledPosition(:) can be used instead.
Deprecated scaledPosition(width:height:) on Vector2Transformable as scaledPosition(x:y:) can be used instead.
Added scaledPositions(:anchor:) to Array of Vector2Transformable so that objects can be scaled based on a specific point or anchor point relative to the bounds.
Deprecated scaledPositions(scale:) on Array of Vector2Transformable as scaledPositions(:) can be used instead.
Deprecated scaledPositions(width:height:) on Array of Vector2Transformable as scaledPositions(x:y:) can be used instead.
Added moved(:to:) to Array of Vector2Transformable so points could be moved based on a RectAnchor from their bounds
Added moved(:to:) to CGRect to move it based on a RectAnchor point.
Added scaled(:anchor:) and scaled(x:y:anchor:) to CGRect to scale it using a RectAnchor as the anchor.
Added rect(at:anchor:) to CGSize to create a rectangle with a specific anchor point located at a specific point.
Added scaled(:) and scaled(_:_:) to CGSize to easily scale the size.
Made corner style animatable on CornerRectangle, CornerPentagon and CornerTriangle.
Added corner radius adjustment to Corner Example with animation.
Removed internal update functions for Corner and CornerStyle animatable extensions.
* Added VectorArray and AnimatableArray to make it easier to make an array of VectorArithmetic or Animatable types conform to VectorArithmetic or Animatable.
Added VectorDictionary and AnimatableDictionary to make it easier to make a dictionary of VectorArithmetic or Animatable types conform to VectorArithmetic or Animatable.
Made CornerTriangle, CornerRectangle, and CornerPentagon styles property animatable (nested corner styles are still not animatable)
* Added .symmetrical corner style that allows for custom symmetrical corner styles using RelativeCorner
Added RelativeCorner. A corner with position based on RectAnchor and a CornerStyle
Added a setter to the radius property of CornerStyle and Corner
Added relative(to:) to CGPoint to create a RectAnchor relative to Corner.Dimensions
Added relative(to:) to Corner to create a RelativeCorner relative to Corner.Dimensions
Removed relative(to:) from Vector2Representable
Added relativeToRhombus(origin:uVector:vVector:) to CGPoint to create a RectAnchor relative to a rhombus.
Added relativeToRhombus(origin:uVector:vVector:) to Corner to create a RelativeCorner relative to a rhombus.
Added startVector, endVector and position(of:RectAnchor) to Corner.Dimensions
Added Stylish protocol but not yet implemented
Added Codable conformance to RectAnchor
Renamed point(in:) to callAsFunction(in:) for RectAnchor
Added crossProduct(with:) to Vector2Algebraic
Moved rect(size:anchor:) and rect(width:height:anchor:) from Vector2Representable to CGPoint
* Changed .symmetrical style to .custom to allow for non-symmetrical custom corner shapes
Added CornerStylish protocol to keep a bunch of methods that apply to both Corner and RelativeCorner
Added CGFrame as a way to describe any rhombus shaped frame with an origin and vectors for the x and y axes.
Added a frame property to Corner.Dimensions
Removed position(of:) method from Corner.Dimensions
Replaced all relativeToRhombus(origin:uVector:vVector:) methods with relative(to:) that work with CGFrame
Removed all relative(to:) functions that work with Corner.Dimensions
Changed CornerStyle cornerStyles property so it can be set as well.
Changed callAsFunction(in:) functions so that they are explicitly called point, points, corner and corners
* Added RectangleExample3
Renamed CornerStylish to CornerStyled
* Glass shape example
* Gated code that's only compatible with Xcode 26
Refactored VectorArray, VectorDictionary, AnimatableArray and AnimatableDictionary
Added extensions to Array or Dictionary of Animatable or VectorArithmetic types with an animatableData property
Made 1 level of CornerStyle animatable.
Added NestedAnimatable for creating reduced animatable properties for one nested level down.
Added radiusOffset and relativeCorner properties to CornerStyle
Made RelativeCorner animatable
Made RectAnchor conform to VectorArithmetic
Updated CornerRectangle, CornerTriangle, and CornerPentagon so their style properties are back to plain dictionaries.
* Fixed corner example for iOS 18 and older
Removed AnimatableArray and enamed VectorArray to AnimatableArray
Removed AnimatableDictionary and enamed VectorDictionary to AnimatableDictionary
Deleted commented-out code for conforming CornerStyle and RelativeCorner to VectorArithmetic
* Updated CornerExample to toggle between regular and glass shapes
* Moved NestedAnimatable to its own file.
Updated documentation on RelativeCorner.
* Rebuilt NotchStyle changing it from an enum to a struct that holds an array of RelativeCorner
Existing triangle, rectangle and custom NotchStyle cases converted to static methods.
Custom NotchStyle is deprecated and may not work correctly given the only way to create notches now is using RelativeCorner.
Added Animatable conformance to NotchStyle and Notch
Changed Notch properties from let to var
Created a new init for Notch that takes an array of RelativeCorner
Added relativeCorner methods to RectAnchor and arrays of rectAnchor
Changed regular/glass toggle in CornerExample to use a button instead of a picker for easier multiplatform support
Moved cornerStyles property from Array of Corner to Array of CornerStyled
Added retroactive to Animatable conformance of Optional ConerStyle
Fixed cornerStyles set method on CornerStyle so that it properly sets styles for relativeCorners
Added corners(in:) methods to array of RelativeCorner
* Added documentation and examples to AnimatableArray, AnimatableDictionary, AnimatablePack, and NestedAnimatable
Added documentation to CGFrame, CGPoint and CGRect
* Updated the readme with CGFrame and fixed a few typos
Added documentation to a few methods and fixed a few typos
Changed the properties on CGFrame to be public var instead of let
* Updated the readme reorganizing thing to better explain ShapeUp
Added subscripts to CGFrame for transforming between RectAnchor, ralative points and CGPoint
Added subscripts to CGRect to get RectAnchor from CGPoint
Reorganized CGFrame and CGRect subscripts for clarity
Moved deprecated CGRect extensions to the bottom
Added scaledPositions that use RectAnchor for Vector2TransformableArray
Adjusted CGSize scaled method so it uses x and y like other similar methods.
* Renamed AnimatablePack folder to Animatable
* Fixed concave corner insetting so it works correctly for reflex angles
Updated ShapeUpLogoView to work with new CGSize scaled method
* Re-arranged the properties in RelativeCorner so the style goes at the end.
Added inits for Corner where the style property is at the end and changed the existing ones to disfavoured overload so it won't be suggested.
Added .custom option for Notch and NotchStyle for easy init and switching from existing Notch.custom
* Removed the disfavoredOverloads and changed to soft deprecation so the old methods won't be suggested.
* Changed most deprecations to soft deprecations.
Updated Notch custom message to better describe how the function may not work as intended.
* Added extra warnings for old custom notch styles
* Fixed a bug where custom corners with empty arrays would not draw at all. Now they draw with a single point as the default.
Updated CornerExample to move the inset slider to the bottom.
* Changed NotchStyle back to an enum
* Added handy static methods to RelativeCorner so it works almost like RectAnchor with style
Added a .custom init for NotchStyle that uses relative corners without needing the array
* Added easy RectAnchor style static methods to RelativeCorner so you can create an unstyled .topLeft.
Added methods to quickly apply styles to CornerStyled types like .rounded(20).
Added applyingStyle to EnumeratedCornerShape and Rectangle for applying a style to a single ShapeCorner
Renamed RelativeShape to RelativeCornerShape and made it public.
Changed x and y properties in the CGRect subscript so that they are labelled again.
Removed anchorPoints init from .custom corner style as it can be handled with relative corners.
Added corners methods to CGRect to quickly create arrays of Corner from arrays of RelativeCorner
Fixed documentation on custom corner style so that it doesn't say it will mirror the points.
Added clear glass to CornerExample
* Added the radius parameter name back to all the corner styles.
* Moved CornerStyled corner style method chaining to its own file.
Added Notch method chaining for notch style.
Removed the Notch init that takes relativeCorners made the style property in the default init optional defaulting to the rectangular notch.
Soft deprecated all the NotchStyle static inits from Notch.
* Updated a couple examples with the new Notch method chaining.
* Removed corners methods from CGRect.
Refactored AddOpenCornerShapeExample so it works with method chaining on rect subscripts instead of a single corners method.
Updated some of the ShapeUpLogoView to remove some parentheses.
* Added subscripts for generating Corner from CGRect. This removes the .corner after each rect[.topLeft] or similar.
* Moved relative(to:) methods from individual types to the RelativeRepresentable protocol. Both CGPoint and Corner conform to this.
Removed previously added Corner inits as they are no longer needed with method chaining.
Moved corner methods from Vector2Representable and added them to their own protocol CornerRepresentable that CGPoint conforms to
* Deleted CornerRepresentable and moved all point and corner parameters and methods back to Vector2Representable
Updated Vector2Transformable scaledPositions methods so they return an array of Self instead of CGPoint.
Added RectAnchorRepresentable and RectAnchorTransformable to allow RectAnchor types to be easily transformed with more appropriate methods than the Vector2 versions (but using Vector2 logic under the hood)
Added RectAnchorTransformable conformance to RectAnchor and RelativeCorner
Fixed init(closed:_:) on RelativeCornerShape so it better matches the other init.
* Removed RectAnchorRepresentable.
Added array extensions to RectAnchorTransformable.
Added localBounds to RectAnchorTransformable arrays.
Fixed flippedVertically method on Vector2Transformable arrays so that it works correctly.
* Renamed "anchorPoint" to "anchor" for any RectAnchor type. It only remains when referring to a CGPoint based on an anchor.
Added relativeToBounds to RelativeRepresentable
* Updated documentation on RectAnchorTransformable.
* CGRect extensions changed so subscript is only used for single points, corners or anchors. subscripts that returns arrays were changed to methods called points and corners for clarity.
Added closed(_:) and applyingStyle(_:) methods to RelativeCornerShape to make it easier to adjust.
BasicCompareExample updated to chevron
Readme updated
* Renamed points(_:) back to points(relativeLocations:) for clarity
CornerStyle properties radiusOffset and relativeCorners changed to internal(set) as it should only be used for animatableData.
Changed animatableData so it only stores an array of relativeCorners and not cornerStyles as well. Removed set option for cornerStyles as it is no longer needed.
NotchStyle relativeCorners property changed to internal(set) as it should only be used for animatableData.
Updated readme
* Quick fix for concave radius inset problem. Result isn't perfect but it is a lot closer. There's still a problem with some angles greater than 90 degrees
* Updated documentation.
* Deprecated AngleType due to problems with equating float values.
Added isApproximatelyStraight(tolerance:) to Corner.Dimensions to help with checks for straight angles.
Fixed calculation errors when dealing with 180 degree (or close enough) corners.
Fixed most issues with concave corners so they only draw incorrectly with reflex concave corners.
* Bugfix: The last point in an array of inset points would not inset correctly. This especially caused a lot of issues with concave corner insetting.
* Bugfix: relative corners and rect anchors would accidentally be translated to the rotation anchor when using rotated(). There still remains a bug with rotating arrays of RectAnchorTransformable
* Bugfix: Concave corners now inset correctly!
Changed the concave corner style so that it stores a concaveInset (same as the value used to inset it) instead of radiusOffset (the distance between the corner point and the concave radius center). This change means concave corners should look consistent even when their angles change.
Lots of changes to the Corner.Dimensions static methods for concave corners.
Added scalarProjection, parallelComponent and perpendicularComponent to Vector2Algebraic
Updates to rotated and flipped methods on Vector2Transformable to account for values very close to zero
Bugfix: Fixed an error that prevented the example app building on Xcode 16
Updated readme with change from radiusOffset to concaveInset
* Added additional test cases and deleted tests for AngleType
* Fixed issue with reflex concave corners not insetting correctly.
* Fixed a bug where Vector2Algebraic perpendicularComponent was reversed.
Added and updated documentation.
* Added CornerArrayBuilder and RelativeCornerArrayBuilder so that CornerCustom, CornerShape and RelativeCornerShape can use trailing closures with ViewBuilder style syntax to list corners (no commas needed as the arrays are generated.
* Renamed RelativeCornerShape to RelativeCornerCustom
Adjusted code to use RelativeCorners.corners(in:) instead of rect.points(relativeLocations:)
Updated CornerCustomExample to use new RelativeCornerCustom shape
Added transformCorners, applyingStyle and applyingStyles methods to CornerCustom and transformRelativeCorners to RelativeCornerCustom
* Updated documentation
* Changed RelativeCorner so that it can now include an offset value.
Updated RelativeCorner Animatable functionality to include this offset
Removed RectAnchorTransformable from RelativeCorner and wrote specific transformationg functions that would take into account the offset
Removed insetAnchor and any transform methods based on local anchors as I think they are overly complicated and not that usefull
Added a default value for the rotation anchor of rotated(_:anchor:) and removed rotated(_:) from Vector2Transformable and RectAnchor
Removed subscripts with arrays of points and anchors from CGFrame as it was already removed from CGRect
Added build expressions to CornerArrayBuilder that error with RelativeCorner
Added build expressions to RelativeCornerArrayBuilder that error with Corner
Changed Corner.addingNotch so the cornerIndex default is zero. This allows for an easy way to add corners between two shapes.
* Added path(closed:) method to arrays of CGPoint
Changed Vector2Representable extensions so they only work on Array as they need to work on elements in the same order and Collection doesn't require that.
Updated readme
* Added CornerStylable for types that can have corner styles applied and left CornerStyled only for types that have a single corner style.
Removed applyingStyle() from Corner and RelativeCorner as it is now in CornerStyled
Removed use of .corner from AddOpenCornerShapeExample
* Easy chainging of corner styles moved from CornerStylable to CornerStyled as it might be confusing when used on arrays without a more specific function name.
Added CornerStylable to RelativeCornerShape and EnumeratedCornerShape
Deprecated applyingStyle methods on Rectangle as it's a bit weird to use Rectangle in place of CornerRectangle.
* Removed RectAnchorTransformable and moved extensions directly onto RectAnchor.
* Replaced deprecated Rectangle exmaples with CornerRectangle
* Changed moved method on RelativeCorner so that it takes RelatableValue. Removed the offset method.
Added components to RelatableValue to easily get the absolute and relative components
Added an custom method to Notch that takes a closure with RelativeCornerArrayBuilder
Added an custom static method to NotchStyle that takes a closure with RelativeCornerArrayBuilder
Added an init to Notch that has a trailing closure with RelativeCornerArrayBuilder
Removed some extra methods on NotchStyle for creating triangle and rectangle notches.
Updated Readme
* Updated Readme
* Fixed documentation on Vector2Transformable.
Added documentation to RelativeCorner transformation methods.
* Added extensions to Path for addOpenCornerShape and addClosedCornerShape that use a trailing CornerArrayBuilder closure.
Updated Readme to better match previous adjustments
Improved various example views in the example app to include code.
* Updated readme
* Added CGFrameRepresentable and moved shared code between CGFrame and CGRect inside
RelativeCorner init matches Corner init starting with the style property
Added RectAnchorArrayBuilder
Fixed availability messages on Notch deprecations
Removed Rectangle method that was added after the latest version and then deprecated (no need to keep it around)
* RelativeCorner corner(in:CGRect) method updated to use CGFrameRepresentable
CGFrame init fixed to remove unused anchor property
RectAnchor hashable method adjusted so named enum location and relative locations that are the same hash as the same thing
CGRect moved method fixed to account for initial origin position
* Updated Readme to remove RectAnchor point subscript
Updated Vector2Transformable repositioned(from:to:) to use CGFrameRepresentable
Fixed bugs in AngleRepresentableTests
* Change RelativeRepresentable to remove the repositioned method
* Renamed applyingStyle to cornerStyle and applyingStyles to cornerStyles
Conformed NotchStyle and Notch to CornerStylable
Renamed applyingStyle on Notch to notchShape
Removed Notch chaining methods for triangle, rectangle and custom
Changed all deprecated messages so they deprecate immediately and not by version number. Adjusted the messaging to show the new notch methods
* Documentation updates
Collection of Relative corner now has a corners(in:) method that takes some CGFrameRepresentation instead of one for CGRect and one for CGFrame
* Fixed Corners and RelativeCorners changing them back to struct from enum so it has an init
Fixed NotchedPentagonExample
* Changed Array<Animatable> extension from animatableData to elementAnimatableData to avoid potential conflicts with animatableData extension on Array<VectorArithmetic>
Made animatableData and elementAnimatableData extensions public
Fixed an error on a deprecation rename
Fixed CGPoint.relative(to:) function so it works even if axes are colinear or if one has a zero length
Added tests for CGPoint.relative(to:)
* Fixed tvOS compilation by commenting out incompatible previews.
Fixed visionOS example app compilation error due to missing Glass effect.
* Documentation updates
* Renamed animatableData to valueAnimatableData for Dictionaries with values that conform to Animatable.
* Created an xcworkspace to easily run the tests and example app from the same place.
Fixed some compiler errors and warnings on the package
* Updated documentation
* Added CHANGELOG
Removed CaseIterable from RectAnchor
Renamed notchShape to notchStyle
Changed Corners to a typealias of [Corner] and RelativeCorners to a typealias of [RelativeCorner]
Added cornerStyles to CornerCustom and deprecated the last applyingStyles method
Added a static method to CornerStyle with custom corners with a trailing closure that builds relative corners.
Added a custom corner example to the readme
* Removed AnchorType completely.
Updated changelog
* Updated tests after AnchorType was removed.
* RelativeRepresentable and the relative(to: some CGFrameRepresentable) method changed to internal.
Array of CGPoint path(closed:) method removed as it was unused.
Updated headers to match filenames.
Updated readme.
* Removed RelativeRepresentable but kept relative(to:) as an internal method on CGPoint and Corner
Removed CGPoint.rect and CGSize.rect methods
Removed CGRect.repositioned(to:)
Moved CornerStylable to its own file
Updated documentation
Updated CHANGELOG
* Updated README and CHANGELOG
* Improved corner path drawing for all styles so it calculates correctly when inset with an angle of zero or 180 degrees.
CornerInsetContinuityExample added to test this functionality.
halfAngleSine, isApproximatelyZero and isApproximatelyStraight added to AngleRepresentable
isApproximatelyStraight removed from Corner.Dimensions
Corner.Dimensions deprecated
Added tests for new AngleRepresentable methods, corner dimension path drawing and corner inset contiuity.
* Documentation update
* Updated subscript deprecation warnings so they nolonger use "renamed" as the fix doesn't work correctly with subscripts.
* Notch may now be used inside CornerArrayBuilder
* Added an automatic corner style that defaults to point and a defaultCornerStyle method that only replaces automatic styles.
Changed CornerStylable protocol so it only requires one transformCornerStyles method and synthesizes cornerStyles, changingRadius, and defaultCornerStyle.
* CornerStylable and CornerStyled APIs narrowed and mutating array helpers deprecated
cornerStyle and changingRadius moved from CornerStylable to CornerStyled
Mutating cornerstyle and notch helpers deprecated
cornerStyles property on arrays of CornerStyled changed to read only
Deprecated applyingStyles methods moved from protocols to their original types so they aren't being applied to extra types that they weren't previously
Deprecation messaging clarified so that defaultCornerStyle is the preferred method for styling CornerStylable values unline applyingStyles that would replace all styles by default.
Updated examples, documentation, changelog, and tests.
* Updated deprecations, tests, and the changelog
* Update to latest settings
* Changing minimum swift tools version to 6.0
Changing OS compatibility to iOS 15+, macOS 12+, watchOS 8+, tvOS 15+, and visionOS 1+
* Renamed AnimatableProperties to AnimatableByProperty and removed all references to "fields".
Cleaned up all places where types conforming to both VectorArithmetic and Animatable would have a conflicting property name.
Updated all shapes that conform to Animatable so they now conform to AnimatableByProperty
Updated readme, changelog and tests
* AnimatableByProperty updated so it no longer has recursive properties. CornerStyle and RelativeCorner updated so they manually select a couple levels of recursion in their animatable properties.
Build expressions for AnimatableByProperty removed as it can use the expressions for Animatable as it conforms to that and provides the same animatableData property.
CGFrame public init added.
* Array update changed so it updates elements in place.
* Renamed AnimatableByProperty to AnimatableProperties
Renamed AnimatableProperties to PropertyDescriptor
Renamed AnimatablePropertiesBuilder to AnimatablePropertyBuilder
* Bugfix for scalar projections onto vectors with zero length.
* Public inits on various AnimatableProperty types changed to internal
* Updated some example shapes so they use AnimatableProperties
Updated Readme and documentation so AnimatableProperties is more clearly defined as the default tool for Animatable conformance.
Updated AnimatableDictionary so it only updates existing properties. It no longer adds keys.
Updated SketchyLine so more properties are animatable
* Fixed a bug with Shape scaleToFit and added tests
Updated documentation and changelog
* Whitespace fixes
* Add Swift compatibility CI
Add GitHub Actions coverage that tests the package with Xcode 16.0, builds every supported Apple platform with Swift 6.0, and runs the macOS test suite on the current Xcode runner. The workflow runs for dev and main changes and cancels superseded runs.
* Updated transformCorners function so it compiles in Swift 6.0
* Fixed traililng comma that crashes in Swift 6.0
* Updated CI to run OS tests on the current version and swift 6.0 compatibility only on macOS
* Deprecated more methods to do with Corner dimensions
Moved notchStyle method from Notch+chaining and deleted that file.
Deleted unused CutoutLocation
Changed RelativeCorner repositioned method to internal
Changed concaveInset property to internal
Updated deprecation messages on Notch static inits
Deprecated more notch static inits
* Made RectAnchor.relative(CGPoint) intarnal
Added a documentation note to CGFrame subscript
* Removed the subscript requirement from CGFrameRepresentable and added it to the extension
Removed point(in: CGRect) and point(in: CGFrame) from RectAnchor and added point(in: some CGFrameRepresentable)
Updated RelatableValue+Arithmatic extensions so it doesn't duplicate extensions provided by AdditiveArithmatic.
Updated SketchyLines so all line properties are animated. Changed the drawAmount property to an optional so that lines can use their own draw amounts.
Deprecated SketchyLine.path(in:drawAmount:) as it's no longer needed.
Updated Shape.scaleToFit tests
Deprecated Shape.scaleToFit(_:aspectRadio:)
* Fixed documentation on Shape scaleToFit
Added tests for SketchyLines
* Added AnimatablePropertyGroup and AnimatablePropertyArray
Adjusted how CornerStyle and RelativeCorner reference each other's properties. CornerStyle now references RelativeCorner directly while RelativeCorner accesses CornerStyle properties indirectly to avoid infinite recursion. They both use the new AnimatablePropertyGroup to isolate animatable values to specific styles.
SketchyLine no longer animates other properties when the edge or draw direction change.
* Added continuous corner rounding style to CornerStyle.rounded.
The style works perfectly at 90 degrees and appears to work at other angles though the radius is not quite right.
* Adjusted continuous corner rendering removing the exact match with SwiftUI continuous path elements (as they were just an approximation and did not match the rendered curve).
Added a RoundedRectangleRendering test to the example app for demonstrating how a RoundedRectangle path is different from the elements of that path.
Updated tests for continuous corner rendering.
* Changed all groups to folders in the example app
Deleted to empty Frameworks group from the example app
* Updated minimum watchOS version to 9
* Updated continuous corner calculations with a new approach from Claude
* Corner.Dimensions made internal instead of just deprecated.
* Add Path.addContinuousCurve
Updated the continuous curve logic
Renamed halvedRadiusAngle to halvedTurnAngle throughout
Added Angle.doubled
Moved Corner.Dimensions..turnAngle out from the continuous corner specific code
Removed two unused methods in Corner.Dimensions: absoluteRadius(radius:maxRadius:) and cutLength(absoluteRadius:halvedNonReflexAngle:)
* Updated Corner and Continuous Corner examples in the app.
It turns out the ShapeUp Continuous corner only matches the path elements of a SwiftUI continuous corner, not the final rendered output.
* Moved the xcworkspace file inside the example app so Swift Package Index and xcodebuild-based CI build the package directly instead of resolving the wrong scheme.
* Added corner curve measurement to the example app
Added a continuous curve path obtained by a private api CGPathCreateWithContinuousRoundedRect
* Refit the continuous corner profile to SwiftUI's rendered shape
- Added ContinuousCornerRasterProbe, which measures a rendered shape from
its raster alone. Accurate to 0.07 of a pixel, pinned by a test against
an exact circle.
- Refitted halfCurvatureSamples to that measurement
- Restored the rendered rectangle comparison test. All six cases pass;
two were failing because of the profile, not the test.
- Remeasured the 90-degree boundary reference samples and updated related tests.
- Added a test regenerating the Gauss-Legendre nodes and weights, so the
recipe stays runnable if a different sample count is ever wanted.
- Documented why the curvature is fitted rather than read off the path
elements.
- Documented Path.addContinuousCurve in the README and updated the
continuous corner examples.
- Updated documentation.
* Added disfavoredOverload to RelatableValue * and / functions so they aren't ambiguous as RelatableValue is expressible by Int and CGFloat
Updated latest xcode project settings
Updated some documentation and formatting in the example app
* Removed flattened and isFlat from Corner, Corner arrays and Dimensions as it is no longer used in any other calculations
concave curve was fixed so the bezier version used the correct end control point. Previously it was using one on the previous line instead of using the previous point.
Path.addContinuousCurve fixed so zero and 180 degrees collapse to straight lines.
Fixed RelatableValue equatable and hashable so they use components meaning .absolut(x) == .mixed(absolute: x, relative: 0) and so on
Fixed documentation issues
Updated tests
* Updated Changelog
* Fixed some ambiguous cos and sin methods that tripped up Swift 6.
Updated github actions so they can be triggered on demand (once the swift compatibility file is on the main thread)
* Changed swift compatibility workflow so it only runs swift build on swift 6.0 instead of swift test
Updated some tests for better type checking and clarity.
* Added new NotchedCornerShapeExample
Updated readme and docs
* Updated changelog1 parent 9a7b129 commit cb8e135
158 files changed
Lines changed: 10976 additions & 2181 deletions
File tree
- .github/workflows
- Example
- ShapeUp.xcworkspace
- ShapeUpExample.xcodeproj
- ShapeUpExample
- BasicShapes
- CodeFeatures
- MessageBubble
- Corner
- NotchedShapes
- Other Tools
- Sources/ShapeUp
- Angle
- Animatable
- CornerShape
- EnumeratedCornerShape
- Corner
- Dimensions
- Emboss
- Notch
- Rect
- RelatableValue
- ShapeUp.docc
- SketchyLines
- Vector2
- _Experimental
- _Extension-Internal
- _Extension-Public
- Tests/ShapeUpTests
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Lines changed: 0 additions & 8 deletions
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 88 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
0 commit comments