Skip to content

Commit ddb4798

Browse files
committed
Merge remote-tracking branch 'origin/develop'
2 parents b5c4256 + 9c9469a commit ddb4798

File tree

5 files changed

+107
-49
lines changed

5 files changed

+107
-49
lines changed

Gridicons.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Pod::Spec.new do |s|
22
s.name = "Gridicons"
3-
s.version = "0.16"
3+
s.version = "0.18"
44
s.summary = "Gridicons is a tiny framework which generates Gridicon images at any resolution."
55

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

1111
s.platform = :ios, "9.0"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

Gridicons/Gridicons/Gridicons.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ public enum GridiconType: Int {
6060
case plugins
6161
case play
6262
case plans
63+
case pin
6364
case phone
6465
case pencil
6566
case pause
@@ -337,6 +338,8 @@ public final class Gridicon: NSObject {
337338
return GridiconsGenerated.imageOfGridiconsplay(size: size)
338339
case .plans:
339340
return GridiconsGenerated.imageOfGridiconsplans(size: size)
341+
case .pin:
342+
return GridiconsGenerated.imageOfGridiconspin(size: size)
340343
case .phone:
341344
return GridiconsGenerated.imageOfGridiconsphone(size: size)
342345
case .pencil:

Gridicons/Gridicons/GridiconsGenerated.swift

Lines changed: 93 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -8263,62 +8263,58 @@ class GridiconsGenerated: NSObject {
82638263
context.restoreGState()
82648264
}
82658265

8266-
class func drawGridiconsfilter(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 16, height: 17), resizing: ResizingBehavior = .aspectFit) {
8266+
class func drawGridiconsfilter(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 24, height: 24), resizing: ResizingBehavior = .aspectFit) {
82678267
/// General Declarations
82688268
let context = UIGraphicsGetCurrentContext()!
8269-
8269+
82708270
/// Resize to Target Frame
82718271
context.saveGState()
8272-
let resizedFrame = resizing.apply(rect: CGRect(x: 0, y: 0, width: 16, height: 17), target: targetFrame)
8272+
let resizedFrame = resizing.apply(rect: CGRect(x: 0, y: 0, width: 24, height: 24), target: targetFrame)
82738273
context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY)
8274-
context.scaleBy(x: resizedFrame.width / 16, y: resizedFrame.height / 17)
8275-
context.translateBy(x: -1171, y: -301)
8276-
8274+
context.scaleBy(x: resizedFrame.width / 24, y: resizedFrame.height / 24)
8275+
82778276
/// gridicons-filter
82788277
do {
82798278
context.saveGState()
8280-
context.translateBy(x: 1171, y: 301)
8281-
8282-
/// filter
8283-
do {
8284-
context.saveGState()
8285-
8286-
/// filter_1_
8287-
do {
8288-
context.saveGState()
8289-
8290-
/// Shape
8291-
let shape = UIBezierPath()
8292-
shape.move(to: CGPoint(x: 14.19, y: 0))
8293-
shape.addLine(to: CGPoint(x: 1.01, y: 0))
8294-
shape.addCurve(to: CGPoint(x: 0, y: 0.99), controlPoint1: CGPoint(x: 0.45, y: -0), controlPoint2: CGPoint(x: 0, y: 0.44))
8295-
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))
8296-
shape.addLine(to: CGPoint(x: 5.6, y: 7))
8297-
shape.addLine(to: CGPoint(x: 5.6, y: 13))
8298-
shape.addLine(to: CGPoint(x: 9.6, y: 17))
8299-
shape.addLine(to: CGPoint(x: 9.6, y: 7))
8300-
shape.addLine(to: CGPoint(x: 14.89, y: 1.71))
8301-
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))
8302-
shape.addCurve(to: CGPoint(x: 14.19, y: 0), controlPoint1: CGPoint(x: 14.71, y: 0.11), controlPoint2: CGPoint(x: 14.45, y: 0))
8303-
shape.addLine(to: CGPoint(x: 14.19, y: 0))
8304-
shape.close()
8305-
shape.move(to: CGPoint(x: 14.19, y: 0))
8306-
context.saveGState()
8307-
context.translateBy(x: 0.41, y: -0)
8308-
shape.usesEvenOddFillRule = true
8309-
UIColor.black.setFill()
8310-
shape.fill()
8311-
context.restoreGState()
8312-
8313-
context.restoreGState()
8314-
}
8315-
8316-
context.restoreGState()
8317-
}
8318-
8279+
8280+
/// Rectangle
8281+
let rectangle = UIBezierPath()
8282+
rectangle.move(to: CGPoint.zero)
8283+
rectangle.addLine(to: CGPoint(x: 24, y: 0))
8284+
rectangle.addLine(to: CGPoint(x: 24, y: 24))
8285+
rectangle.addLine(to: CGPoint(x: 0, y: 24))
8286+
rectangle.addLine(to: CGPoint.zero)
8287+
rectangle.close()
8288+
8289+
/// Shape
8290+
let shape = UIBezierPath()
8291+
shape.move(to: CGPoint(x: 7, y: 14))
8292+
shape.addLine(to: CGPoint(x: 11, y: 14))
8293+
shape.addLine(to: CGPoint(x: 11, y: 12))
8294+
shape.addLine(to: CGPoint(x: 7, y: 12))
8295+
shape.addLine(to: CGPoint(x: 7, y: 14))
8296+
shape.close()
8297+
shape.move(to: CGPoint(x: 3, y: 8))
8298+
shape.addLine(to: CGPoint(x: 15, y: 8))
8299+
shape.addLine(to: CGPoint(x: 15, y: 6))
8300+
shape.addLine(to: CGPoint(x: 3, y: 6))
8301+
shape.addLine(to: CGPoint(x: 3, y: 8))
8302+
shape.close()
8303+
shape.move(to: CGPoint.zero)
8304+
shape.addLine(to: CGPoint(x: 0, y: 2))
8305+
shape.addLine(to: CGPoint(x: 18, y: 2))
8306+
shape.addLine(to: CGPoint(x: 18, y: 0))
8307+
shape.addLine(to: CGPoint.zero)
8308+
shape.close()
8309+
context.saveGState()
8310+
context.translateBy(x: 3, y: 5)
8311+
UIColor.black.setFill()
8312+
shape.fill()
8313+
context.restoreGState()
8314+
83198315
context.restoreGState()
83208316
}
8321-
8317+
83228318
context.restoreGState()
83238319
}
83248320

@@ -12370,6 +12366,46 @@ class GridiconsGenerated: NSObject {
1237012366
context.restoreGState()
1237112367
}
1237212368

12369+
class func drawGridiconspin(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 14, height: 20), resizing: ResizingBehavior = .aspectFit) {
12370+
12371+
let context = UIGraphicsGetCurrentContext()!
12372+
12373+
/// Resize to Target Frame
12374+
context.saveGState()
12375+
let resizedFrame = resizing.apply(rect: CGRect(x: 0, y: 0, width: 14, height: 20), target: targetFrame)
12376+
context.translateBy(x: resizedFrame.minX, y: resizedFrame.minY)
12377+
context.scaleBy(x: resizedFrame.width / 14, y: resizedFrame.height / 20)
12378+
12379+
/// gridicons-pin
12380+
let bezierPath = UIBezierPath()
12381+
bezierPath.move(to: CGPoint(x: 14, y: 15))
12382+
bezierPath.addCurve(to: CGPoint(x: 11, y: 10.08), controlPoint1: CGPoint(x: 14, y: 12.96), controlPoint2: CGPoint(x: 12.81, y: 11.16))
12383+
bezierPath.addLine(to: CGPoint(x: 11, y: 3))
12384+
bezierPath.addLine(to: CGPoint(x: 11.5, y: 3))
12385+
bezierPath.addCurve(to: CGPoint(x: 13, y: 1.5), controlPoint1: CGPoint(x: 12.33, y: 3), controlPoint2: CGPoint(x: 13, y: 2.33))
12386+
bezierPath.addCurve(to: CGPoint(x: 11.5, y: 0), controlPoint1: CGPoint(x: 13, y: 0.67), controlPoint2: CGPoint(x: 12.33, y: 0))
12387+
bezierPath.addLine(to: CGPoint(x: 2.5, y: 0))
12388+
bezierPath.addCurve(to: CGPoint(x: 1, y: 1.5), controlPoint1: CGPoint(x: 1.67, y: 0), controlPoint2: CGPoint(x: 1, y: 0.67))
12389+
bezierPath.addCurve(to: CGPoint(x: 2.5, y: 3), controlPoint1: CGPoint(x: 1, y: 2.33), controlPoint2: CGPoint(x: 1.67, y: 3))
12390+
bezierPath.addLine(to: CGPoint(x: 3, y: 3))
12391+
bezierPath.addLine(to: CGPoint(x: 3, y: 10.08))
12392+
bezierPath.addCurve(to: CGPoint(x: 0, y: 15), controlPoint1: CGPoint(x: 1.19, y: 11.16), controlPoint2: CGPoint(x: 0, y: 12.96))
12393+
bezierPath.addLine(to: CGPoint(x: 6, y: 15))
12394+
bezierPath.addLine(to: CGPoint(x: 6, y: 19))
12395+
bezierPath.addCurve(to: CGPoint(x: 7, y: 20), controlPoint1: CGPoint(x: 6, y: 19.55), controlPoint2: CGPoint(x: 6.45, y: 20))
12396+
bezierPath.addCurve(to: CGPoint(x: 8, y: 19), controlPoint1: CGPoint(x: 7.55, y: 20), controlPoint2: CGPoint(x: 8, y: 19.55))
12397+
bezierPath.addLine(to: CGPoint(x: 8, y: 15))
12398+
bezierPath.addLine(to: CGPoint(x: 14, y: 15))
12399+
bezierPath.close()
12400+
context.saveGState()
12401+
bezierPath.usesEvenOddFillRule = true
12402+
UIColor.black.setFill()
12403+
bezierPath.fill()
12404+
context.restoreGState()
12405+
12406+
context.restoreGState()
12407+
}
12408+
1237312409

1237412410
//MARK: - Canvas Images
1237512411

@@ -14377,6 +14413,17 @@ class GridiconsGenerated: NSObject {
1437714413
return image
1437814414
}
1437914415

14416+
class func imageOfGridiconspin(size: CGSize) -> UIImage {
14417+
var image: UIImage
14418+
14419+
UIGraphicsBeginImageContextWithOptions(size, false, 0)
14420+
GridiconsGenerated.drawGridiconspin(frame: CGRect(origin: CGPoint.zero, size: size))
14421+
image = UIGraphicsGetImageFromCurrentImageContext()!
14422+
UIGraphicsEndImageContext()
14423+
14424+
return image
14425+
}
14426+
1438014427
//MARK: - Resizing Behavior
1438114428

1438214429
enum ResizingBehavior {

Gridicons/Gridicons/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<key>CFBundlePackageType</key>
1616
<string>FMWK</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>0.16</string>
18+
<string>0.18</string>
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>

0 commit comments

Comments
 (0)