 		layers.reverse()
 
 		for parent in layers
-			factorX = if parent._parentOrContext() then parent._parentOrContext().screenScaleX() else 1
-			factorY = if parent._parentOrContext() then parent._parentOrContext().screenScaleY() else 1
-			layerScaledFrame = parent.scaledFrame()
+			p = parentOrContext(parent)
+			factorX = p?.screenScaleX?() ? 1
+			factorY = p?.screenScaleY?() ? 1
+			layerScaledFrame = parent.scaledFrame?() ? {x: 0, y: 0}
 			frame.x += layerScaledFrame.x * factorX
 			frame.y += layerScaledFrame.y * factorY
 

		@x = parseInt @x
		@y = parseInt @y

	@define "devicePixelRatio",
		get: -> @context.devicePixelRatio

	updateForDevicePixelRatioChange: =>
		for cssProperty in ["width", "height", "webkitTransform", "boxShadow", "textShadow", "borderRadius", "border", "fontSize", "letterSpacing", "wordSpacing", "textIndent"]
			@_element.style[cssProperty] = LayerStyle[cssProperty](@)

		importable: true
		exportable: false
		get: ->
			return Utils.boundingFrame(@, false)
		set: (frame) ->
			@frame = Utils.convertFrameFromContext(frame, @, false, false)

