Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
mindgraffiti committed Jan 16, 2019
2 parents b5c4256 + 9c9469a commit ddb4798
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 49 deletions.
4 changes: 2 additions & 2 deletions Gridicons.podspec
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Pod::Spec.new do |s|
s.name = "Gridicons"
s.version = "0.16"
s.version = "0.18"
s.summary = "Gridicons is a tiny framework which generates Gridicon images at any resolution."

s.homepage = "http://apps.wordpress.com"
s.license = { :type => "GPLv2" }
s.author = { "James Frost" => "james.frost@automattic.com" }
s.author = { "Automattic" => "mobile@automattic.com" }
s.social_media_url = "http://twitter.com/WordPressiOS"

s.platform = :ios, "9.0"
Expand Down
8 changes: 8 additions & 0 deletions Gridicons.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
3 changes: 3 additions & 0 deletions Gridicons/Gridicons/Gridicons.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public enum GridiconType: Int {
case plugins
case play
case plans
case pin
case phone
case pencil
case pause
Expand Down Expand Up @@ -337,6 +338,8 @@ public final class Gridicon: NSObject {
return GridiconsGenerated.imageOfGridiconsplay(size: size)
case .plans:
return GridiconsGenerated.imageOfGridiconsplans(size: size)
case .pin:
return GridiconsGenerated.imageOfGridiconspin(size: size)
case .phone:
return GridiconsGenerated.imageOfGridiconsphone(size: size)
case .pencil:
Expand Down
139 changes: 93 additions & 46 deletions Gridicons/Gridicons/GridiconsGenerated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8263,62 +8263,58 @@ class GridiconsGenerated: NSObject {
context.restoreGState()
}

class func drawGridiconsfilter(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 16, height: 17), resizing: ResizingBehavior = .aspectFit) {
class func drawGridiconsfilter(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 24, height: 24), resizing: ResizingBehavior = .aspectFit) {
/// General Declarations
let context = UIGraphicsGetCurrentContext()!

/// Resize to Target Frame
context.saveGState()
let resizedFrame = resizing.apply(rect: CGRect(x: 0, y: 0, width: 16, height: 17), target: targetFrame)
let resizedFrame = resizing.apply(rect: CGRect(x: 0, y: 0, width: 24, height: 24), target: targetFrame)
context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY)
context.scaleBy(x: resizedFrame.width / 16, y: resizedFrame.height / 17)
context.translateBy(x: -1171, y: -301)

context.scaleBy(x: resizedFrame.width / 24, y: resizedFrame.height / 24)

/// gridicons-filter
do {
context.saveGState()
context.translateBy(x: 1171, y: 301)

/// filter
do {
context.saveGState()

/// filter_1_
do {
context.saveGState()

/// Shape
let shape = UIBezierPath()
shape.move(to: CGPoint(x: 14.19, y: 0))
shape.addLine(to: CGPoint(x: 1.01, y: 0))
shape.addCurve(to: CGPoint(x: 0, y: 0.99), controlPoint1: CGPoint(x: 0.45, y: -0), controlPoint2: CGPoint(x: 0, y: 0.44))
shape.addCurve(to: CGPoint(x: 0.3, y: 1.71), controlPoint1: CGPoint(x: -0, y: 1.26), controlPoint2: CGPoint(x: 0.11, y: 1.52))
shape.addLine(to: CGPoint(x: 5.6, y: 7))
shape.addLine(to: CGPoint(x: 5.6, y: 13))
shape.addLine(to: CGPoint(x: 9.6, y: 17))
shape.addLine(to: CGPoint(x: 9.6, y: 7))
shape.addLine(to: CGPoint(x: 14.89, y: 1.71))
shape.addCurve(to: CGPoint(x: 14.89, y: 0.3), controlPoint1: CGPoint(x: 15.28, y: 1.32), controlPoint2: CGPoint(x: 15.28, y: 0.69))
shape.addCurve(to: CGPoint(x: 14.19, y: 0), controlPoint1: CGPoint(x: 14.71, y: 0.11), controlPoint2: CGPoint(x: 14.45, y: 0))
shape.addLine(to: CGPoint(x: 14.19, y: 0))
shape.close()
shape.move(to: CGPoint(x: 14.19, y: 0))
context.saveGState()
context.translateBy(x: 0.41, y: -0)
shape.usesEvenOddFillRule = true
UIColor.black.setFill()
shape.fill()
context.restoreGState()

context.restoreGState()
}

context.restoreGState()
}


/// Rectangle
let rectangle = UIBezierPath()
rectangle.move(to: CGPoint.zero)
rectangle.addLine(to: CGPoint(x: 24, y: 0))
rectangle.addLine(to: CGPoint(x: 24, y: 24))
rectangle.addLine(to: CGPoint(x: 0, y: 24))
rectangle.addLine(to: CGPoint.zero)
rectangle.close()

/// Shape
let shape = UIBezierPath()
shape.move(to: CGPoint(x: 7, y: 14))
shape.addLine(to: CGPoint(x: 11, y: 14))
shape.addLine(to: CGPoint(x: 11, y: 12))
shape.addLine(to: CGPoint(x: 7, y: 12))
shape.addLine(to: CGPoint(x: 7, y: 14))
shape.close()
shape.move(to: CGPoint(x: 3, y: 8))
shape.addLine(to: CGPoint(x: 15, y: 8))
shape.addLine(to: CGPoint(x: 15, y: 6))
shape.addLine(to: CGPoint(x: 3, y: 6))
shape.addLine(to: CGPoint(x: 3, y: 8))
shape.close()
shape.move(to: CGPoint.zero)
shape.addLine(to: CGPoint(x: 0, y: 2))
shape.addLine(to: CGPoint(x: 18, y: 2))
shape.addLine(to: CGPoint(x: 18, y: 0))
shape.addLine(to: CGPoint.zero)
shape.close()
context.saveGState()
context.translateBy(x: 3, y: 5)
UIColor.black.setFill()
shape.fill()
context.restoreGState()

context.restoreGState()
}

context.restoreGState()
}

Expand Down Expand Up @@ -12370,6 +12366,46 @@ class GridiconsGenerated: NSObject {
context.restoreGState()
}

class func drawGridiconspin(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 14, height: 20), resizing: ResizingBehavior = .aspectFit) {

let context = UIGraphicsGetCurrentContext()!

/// Resize to Target Frame
context.saveGState()
let resizedFrame = resizing.apply(rect: CGRect(x: 0, y: 0, width: 14, height: 20), target: targetFrame)
context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY)
context.scaleBy(x: resizedFrame.width / 14, y: resizedFrame.height / 20)

/// gridicons-pin
let bezierPath = UIBezierPath()
bezierPath.move(to: CGPoint(x: 14, y: 15))
bezierPath.addCurve(to: CGPoint(x: 11, y: 10.08), controlPoint1: CGPoint(x: 14, y: 12.96), controlPoint2: CGPoint(x: 12.81, y: 11.16))
bezierPath.addLine(to: CGPoint(x: 11, y: 3))
bezierPath.addLine(to: CGPoint(x: 11.5, y: 3))
bezierPath.addCurve(to: CGPoint(x: 13, y: 1.5), controlPoint1: CGPoint(x: 12.33, y: 3), controlPoint2: CGPoint(x: 13, y: 2.33))
bezierPath.addCurve(to: CGPoint(x: 11.5, y: 0), controlPoint1: CGPoint(x: 13, y: 0.67), controlPoint2: CGPoint(x: 12.33, y: 0))
bezierPath.addLine(to: CGPoint(x: 2.5, y: 0))
bezierPath.addCurve(to: CGPoint(x: 1, y: 1.5), controlPoint1: CGPoint(x: 1.67, y: 0), controlPoint2: CGPoint(x: 1, y: 0.67))
bezierPath.addCurve(to: CGPoint(x: 2.5, y: 3), controlPoint1: CGPoint(x: 1, y: 2.33), controlPoint2: CGPoint(x: 1.67, y: 3))
bezierPath.addLine(to: CGPoint(x: 3, y: 3))
bezierPath.addLine(to: CGPoint(x: 3, y: 10.08))
bezierPath.addCurve(to: CGPoint(x: 0, y: 15), controlPoint1: CGPoint(x: 1.19, y: 11.16), controlPoint2: CGPoint(x: 0, y: 12.96))
bezierPath.addLine(to: CGPoint(x: 6, y: 15))
bezierPath.addLine(to: CGPoint(x: 6, y: 19))
bezierPath.addCurve(to: CGPoint(x: 7, y: 20), controlPoint1: CGPoint(x: 6, y: 19.55), controlPoint2: CGPoint(x: 6.45, y: 20))
bezierPath.addCurve(to: CGPoint(x: 8, y: 19), controlPoint1: CGPoint(x: 7.55, y: 20), controlPoint2: CGPoint(x: 8, y: 19.55))
bezierPath.addLine(to: CGPoint(x: 8, y: 15))
bezierPath.addLine(to: CGPoint(x: 14, y: 15))
bezierPath.close()
context.saveGState()
bezierPath.usesEvenOddFillRule = true
UIColor.black.setFill()
bezierPath.fill()
context.restoreGState()

context.restoreGState()
}


//MARK: - Canvas Images

Expand Down Expand Up @@ -14377,6 +14413,17 @@ class GridiconsGenerated: NSObject {
return image
}

class func imageOfGridiconspin(size: CGSize) -> UIImage {
var image: UIImage

UIGraphicsBeginImageContextWithOptions(size, false, 0)
GridiconsGenerated.drawGridiconspin(frame: CGRect(origin: CGPoint.zero, size: size))
image = UIGraphicsGetImageFromCurrentImageContext()!
UIGraphicsEndImageContext()

return image
}

//MARK: - Resizing Behavior

enum ResizingBehavior {
Expand Down
2 changes: 1 addition & 1 deletion Gridicons/Gridicons/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.16</string>
<string>0.18</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down

0 comments on commit ddb4798

Please sign in to comment.