rougeware / swift-rectangle-tools Goto Github PK
View Code? Open in Web Editor NEWA set of Swift utilities for dealing with rectangles, including a way to generically build your own!
License: Other
A set of Swift utilities for dealing with rectangles, including a way to generically build your own!
License: Other
I've run into this with shuffled()
, so that can be the SSCCE
Currently, all scaling methods except .stretch
have different behavior for .down
vs .upOrDown
scaling directions. .stretch
always behaves as if its direction is .upOrDown
; it should be changed so that when its direction is .down
, neither size dimension increases.
Sizes, Points, and Rects should all conform to these in this package:
Equatable
Hashable
Just treat them similar to rectangles of the same size at origin (0,0)
Now that we have MultiplicativeArithmetic
, it can be added as a dependency and the code made more extensively applicable.
It should be easy to add iOS support to this library
Imagine if you are making an image and size is a BinaryIntegerSize
. Wouldn't it be nice to just map that size to a set of pixels?
/Path/To/Swift-Rectangle-Tools/Sources/RectangleTools/Default Conformances/EdgeInsets + FourSided.swift:97:19: error: no type named 'EdgeInsets' in module 'SwiftUI'
extension SwiftUI.EdgeInsets: FourSidedAbsolute {
^
/Path/To/Swift-Rectangle-Tools/Sources/RectangleTools/Default Conformances/EdgeInsets + FourSided.swift:124:26: error: no type named 'EdgeInsets' in module 'SwiftUI'
public extension SwiftUI.EdgeInsets {
^
This would allow API consumers to take advantage of a lot of work I've done to make Point2D
easy to work with
I should be able to convert a UIntPoint
to a CGPoint
, or a CGSize
to a DecimalSize
, or an IntRect
to a CGRect
. Initializers should be provided which behave like those in the Swift standard library, where the common ones approximāte if the value can't be perfectly represented, and there are others provided which will fail if the other value would be approximately converted.
For instance: frame.midXmaxY
for the point at the top-center of the rectangle
It should show off some of the APIs and stuff
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.