Skip to content
Permalink
Browse files

Reset artboard coordinates to 0, 0

  • Loading branch information...
Koen Bok
Koen Bok committed Dec 18, 2015
1 parent 58ad551 commit 3f2c0e2575fbcf6c7e83ecbebc595a4068729905
@@ -189,17 +189,16 @@ class exports.Importer
layer.visible = true
points.push(layer.point)

# # Calculate the artboard positions to always be 0,0.
# pointOffset =
# x: Math.min.apply(@, points.map (p) -> p.x)
# y: Math.min.apply(@, points.map (p) -> p.y)

# # Correct the layers
# for layer in layers
# if layer._info.kind is "artboard"
# layer.x -= pointOffset.x
# layer.y -= pointOffset.y
# Calculate the artboard positions to always be 0,0.
pointOffset =
x: Math.min.apply(@, points.map (p) -> p.x)
y: Math.min.apply(@, points.map (p) -> p.y)

# Correct the artboard positions to 0,0.
for layer in layers
if layer._info.kind is "artboard"
layer.x -= pointOffset.x
layer.y -= pointOffset.y

_correctLayer: (layer) ->

@@ -10,8 +10,8 @@
},
"iPhone6": {
"frame": {
"x": 100,
"y": 100,
"x": 0,
"y": 0,
"width": 375,
"height": 667
},
@@ -10,8 +10,8 @@
},
"iPhone6": {
"frame": {
"x": 200,
"y": 200,
"x": 0,
"y": 0,
"width": 750,
"height": 1334
},

0 comments on commit 3f2c0e2

Please sign in to comment.
You can’t perform that action at this time.