Skip to content

Commit 95bbc18

Browse files
committed
Fix plugin for Sketch 86
Error due to Sketch refactoring: NSColorSpace to CGColorSpace TypeError: null is not an object (evaluating 'bitmapRepresentation.CGImage') https://sketchplugins.com/d/2467-error-evaluating-bitmaprepresentationcgimage-after-sketch-86-update
1 parent 91c2cc9 commit 95bbc18

File tree

7 files changed

+44
-16
lines changed

7 files changed

+44
-16
lines changed
Loading
-9.65 KB
Loading
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,49 @@
11
{
22
"bundleVersion": 1,
3-
"version": "1.1.6",
3+
"version": "1.1.7",
44
"icon": "icon.png",
55
"identifier": "io.designcode.Angle",
6-
"description": "Important note: use version 1.1.6 for Sketch 72+, version 1.1.5 for Sketch 66 to Sketch 71 and 1.1.4 for Sketch 65 and earlier. Apply perspective transforms on screen mockups. Auto-detect screens by resolution and works on shapes and symbols.",
6+
"description": "Important note: use version 1.1.7 for Sketch 86+, version 1.1.6 for Sketch 72-85, version 1.1.5 for Sketch 66-71 and version 1.1.4 for Sketch 65 and earlier. Apply perspective transforms on screen mockups. Auto-detect screens by resolution and works on shapes and symbols.",
77
"homepage": "https://angle.sh",
88
"author": "Design+Code",
9-
"authorEmail": "support@designcode.io",
9+
"authorEmail": "angle@designcode.io",
1010
"compatibleVersion": 50,
1111
"commands": [
12+
{
13+
"name": "Rotate Mockup",
14+
"identifier": "Angle-Rotate-Mockup",
15+
"script": "__rotate.js",
16+
"shortcut": "control \\"
17+
},
18+
{
19+
"name": "Flip Mockup",
20+
"identifier": "Angle-Rotate-Flip",
21+
"script": "__symmetry.js",
22+
"shortcut": "cmd shift \\"
23+
},
1224
{
1325
"name": "Apply Mockup",
1426
"identifier": "Angle-Apply-Mockup",
15-
"script": "apply.js",
27+
"script": "__apply.js",
1628
"shortcut": "cmd \\"
29+
},
30+
{
31+
"name": "Reset Mockup",
32+
"identifier": "Angle-Reset-Metadata",
33+
"script": "__reset.js",
34+
"shortcut": "cmd control \\"
1735
}
1836
],
1937
"menu": {
2038
"title": "Angle",
21-
"items": ["Angle-Apply-Mockup"]
39+
"items": [
40+
"Angle-Apply-Mockup",
41+
"Angle-Rotate-Flip",
42+
"Angle-Rotate-Mockup",
43+
"Angle-Reset-Metadata"
44+
]
2245
},
2346
"name": "Angle",
2447
"disableCocoaScriptPreprocessor": true,
2548
"appcast": "https://raw.githubusercontent.com/MengTo/Angle-Sketch-Plugin/master/.appcast.xml"
26-
}
49+
}

README.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,12 @@ Make sure you have the latest version of Sketch (72+) running on macOS Catalina
1313
- [Download the zip file](https://github.com/MengTo/Angle-Sketch-Plugin/archive/master.zip).
1414
- Double-click on Angle.sketchplugin
1515

16-
**Important note:**
17-
use version [1.1.6](https://github.com/MengTo/Angle-Sketch-Plugin/releases/download/v1.1.6/Angle.sketchplugin.zip) for Sketch 72+
18-
use version [1.1.5](https://github.com/MengTo/Angle-Sketch-Plugin/releases/download/v1.1.5/Angle.sketchplugin.zip) for Sketch 66 to Sketch 71.2
19-
use version [1.1.4](https://github.com/MengTo/Angle-Sketch-Plugin/releases/download/v1.1.4/Angle.sketchplugin.zip) for Sketch 65 and earlier.
16+
#### Important note:
17+
18+
- use version [1.1.7](https://github.com/MengTo/Angle-Sketch-Plugin/releases/download/v1.1.7/Angle.sketchplugin.zip) for Sketch 86+
19+
- use version [1.1.6](https://github.com/MengTo/Angle-Sketch-Plugin/releases/download/v1.1.6/Angle.sketchplugin.zip) for Sketch 72 to Sketch 85.1
20+
- use version [1.1.5](https://github.com/MengTo/Angle-Sketch-Plugin/releases/download/v1.1.5/Angle.sketchplugin.zip) for Sketch 66 to Sketch 71.2
21+
- use version [1.1.4](https://github.com/MengTo/Angle-Sketch-Plugin/releases/download/v1.1.4/Angle.sketchplugin.zip) for Sketch 65 and earlier.
2022

2123
Apply perspective transforms on screen mockups. Auto-detect screens by resolution and works on shapes and symbols.
2224

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"name": "angle",
3-
"version": "6",
3+
"version": "1.1.7",
44
"repository": "https://github.com/MengTo/Angle-Sketch-Plugin",
5-
"description": "Important note: use version 1.1.6 for Sketch 72+, version 1.1.5 for Sketch 66 to Sketch 71 and 1.1.4 for Sketch 65 and earlier. Apply perspective transforms on screen mockups. Auto-detect screens by resolution and works on shapes and symbols.",
5+
"description": "Important note: use version 1.1.7 for Sketch 86+, version 1.1.6 for Sketch 72-85, version 1.1.5 for Sketch 66-71 and version 1.1.4 for Sketch 65 and earlier. Apply perspective transforms on screen mockups. Auto-detect screens by resolution and works on shapes and symbols.",
66
"engines": {
77
"sketch": ">=3.0"
88
},

src/Angle.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ export default class Angle {
171171
}
172172

173173
exporter() {
174-
const colorSpace = this.context.document.colorSpace();
174+
const colorSpace = this.context.document.colorSpace().CGColorSpace();
175175

176176
const sketchVersion = BCSketchInfo.shared().metadata().appVersion;
177177
if (sketchVersion < 52)
@@ -194,7 +194,10 @@ export default class Angle {
194194

195195
ciImage() {
196196
const bitmapRepresentation = this.exporter().bitmapImageRep();
197+
197198
return CIImage.alloc().initWithCGImage(bitmapRepresentation.CGImage());
199+
// Below works too
200+
// return CIImage.alloc().initWithBitmapImageRep(bitmapRepresentation);
198201
}
199202

200203
// ---------------------------------

src/manifest.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"bundleVersion": 1,
3-
"version": "1.1.6",
3+
"version": "1.1.7",
44
"icon": "icon.png",
55
"identifier": "io.designcode.Angle",
6-
"description": "Important note: use version 1.1.6 for Sketch 72+, version 1.1.5 for Sketch 66 to Sketch 71 and 1.1.4 for Sketch 65 and earlier. Apply perspective transforms on screen mockups. Auto-detect screens by resolution and works on shapes and symbols.",
6+
"description": "Important note: use version 1.1.7 for Sketch 86+, version 1.1.6 for Sketch 72-85, version 1.1.5 for Sketch 66-71 and version 1.1.4 for Sketch 65 and earlier. Apply perspective transforms on screen mockups. Auto-detect screens by resolution and works on shapes and symbols.",
77
"homepage": "https://angle.sh",
88
"author": "Design+Code",
9-
"authorEmail": "support@designcode.io",
9+
"authorEmail": "angle@designcode.io",
1010
"compatibleVersion": 50,
1111
"commands": [
1212
{

0 commit comments

Comments
 (0)