Commit bb611c88 authored by Kelly Nichols's avatar Kelly Nichols

Added parsing of artboard layer data

parent 297c9935
...@@ -3,11 +3,11 @@ Util = require '../util.coffee' ...@@ -3,11 +3,11 @@ Util = require '../util.coffee'
# This is an incredibly important object because the majority of the layer information # This is an incredibly important object because the majority of the layer information
# is contained in layer info blocks. The keys of this object define how the layer info # is contained in layer info blocks. The keys of this object define how the layer info
# can be accessed. Each layer info block contains different data, so accessing the data # can be accessed. Each layer info block contains different data, so accessing the data
# within each differs from type to type. # within each differs from type to type.
# #
# Here's an example of how to access some of this data: # Here's an example of how to access some of this data:
# #
# ``` coffeescript # ``` coffeescript
# node = psd.tree().childrenAtPath('path/to/layer')[0] # node = psd.tree().childrenAtPath('path/to/layer')[0]
# node.get('locked').allLocked # node.get('locked').allLocked
...@@ -15,6 +15,7 @@ Util = require '../util.coffee' ...@@ -15,6 +15,7 @@ Util = require '../util.coffee'
# node.get('typeTool').export() # node.get('typeTool').export()
# ``` # ```
LAYER_INFO = { LAYER_INFO = {
artboard: require('../layer_info/artboard.coffee')
blendClippingElements: require('../layer_info/blend_clipping_elements.coffee') blendClippingElements: require('../layer_info/blend_clipping_elements.coffee')
blendInteriorElements: require('../layer_info/blend_interior_elements.coffee') blendInteriorElements: require('../layer_info/blend_interior_elements.coffee')
fillOpacity: require('../layer_info/fill_opacity.coffee') fillOpacity: require('../layer_info/fill_opacity.coffee')
......
LayerInfo = require '../layer_info.coffee'
Descriptor = require '../descriptor.coffee'
module.exports = class Artboard extends LayerInfo
@shouldParse: (key) -> key is 'artb'
parse: ->
@file.seek 4, true
@data = new Descriptor(@file).parse()
export: ->
coords:
left: @data.artboardRect['Left']
top: @data.artboardRect['Top ']
right: @data.artboardRect['Rght']
bottom: @data.artboardRect['Btom']
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment