jesselcampbell / framer-module-textlayer-textstyle

Extending the Framer TextLayer with text styles that work like CSS classes
4 stars 1 forks source link

fontSize doesn't update in new version of Framer #1

Open blaineb opened 7 years ago

blaineb commented 7 years ago

Do you happen to know why fontSize doesn't update in the new version of Framer? is there a way to make it work? I can't seem to sort out why.

jesselcampbell commented 7 years ago

@blaineb thanks for catching this. Haven't been using Framer for a while, as the projects I'm on have been more development focused. I just realized my Framer license has expired, which means I can't do any testing at the moment. 👎

I had a look at the most recent docs and didn't see anything glaring at me. The one thing I did notice is that the font property accepts a ...px string, but the fontSize property accepts a number. Maybe they messed up the docs and fontSize now accepts a px value? Would be easy enough to test by changing @fontSize: 24 to @fontSize: "24px" in textstyle.coffee.

Sorry I can't be any more help at the moment. 😄

blaineb commented 7 years ago

Np, I scoped it out and it looks like TextLayer has a lot of funkiness with the order in which getters and setters update, so extending it has tons of weird unintended consequences. Steve Ruiz offered fix that I think will work, although its a bit hacky. He pointed out that adding a 0 second delay seemed to give Framer enough time to sort through the setting of the fontSize.

Utils.delay 0, => @fontSize = 24

Works, as an FYI to anyone else who is experiencing this.