Permalink
Browse files

Merge pull request #526 from koenbok/feature/vekter-text

Feature/vekter text
  • Loading branch information...
nvh committed Jul 7, 2017
2 parents 5317cbc + bb9b792 commit 1cb646c486c48d305f815230a1cc0c755ff3ce5b
Showing with 685 additions and 176 deletions.
  1. +6 −6 extras/Studio.framer/framer/coffee-script.js
  2. +4 −1 framer/BaseClass.coffee
  3. +4 −2 framer/Layer.coffee
  4. +471 −138 framer/TextLayer.coffee
  5. +200 −29 test/tests/TextLayerTest.coffee

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -68,7 +68,9 @@ class exports.BaseClass extends EventEmitter
return _.extend options,
default: fallback
get: -> @_getPropertyValue(name)
set: (value) -> @_setPropertyValue(name, value)
set: (value) ->
@_setPropertyValue(name, value)
options?.didSet?(@, value)
@proxyProperty = (keyPath, options={}) ->
@@ -84,6 +86,7 @@ class exports.BaseClass extends EventEmitter
set: (value) ->
return unless _.isObject(@[objectKey])
Utils.setValueForKeyPath(@, keyPath, value)
options?.didSet?(@, value)
proxy: true
_setPropertyValue: (k, v) =>
View
@@ -63,7 +63,6 @@ layerProperty = (obj, name, cssProperty, fallback, validator, transformer, optio
style = LayerStyle[cssProperty](@)
mainElement?.style[cssProperty] = style
subElement?.style[cssProperty] = style
set?(@, value)
# We try to not send any events while we run the constructor, it just
@@ -168,6 +167,9 @@ class exports.Layer extends BaseClass
# We have to create the element before we set the defaults
@_createElement()
if options.createHTMLElement
@_createHTMLElementIfNeeded()
# Create border element
@_elementBorder = document.createElement("div")
@_element.appendChild(@_elementBorder)
@@ -336,7 +338,7 @@ class exports.Layer extends BaseClass
# Color properties
@define "backgroundColor", layerProperty(@, "backgroundColor", "backgroundColor", null, Color.validColorValue, Color.toColor)
@define "color", layerProperty(@, "color", "color", null, Color.validColorValue, Color.toColor)
@define "color", layerProperty(@, "color", "color", null, Color.validColorValue, Color.toColor, null, null, "_elementHTML", true)
# Border properties
@define "borderRadius", layerProperty(@, "borderRadius", "borderRadius", 0, null, asBorderRadius, null, null, "_elementBorder", true, true)
Oops, something went wrong.

0 comments on commit 1cb646c

Please sign in to comment.