noya-app/noya

New text layers should use the same style as the text layer edited most recently

dabbott opened this issue · 0 comments

We can improve the text editing experience by improving how we set the style of new text layers.

  • Initially, we use a default text style for new text layers
  • However, after the user has edited a text layer (let's call it A), if they create a new text layer B, then the style of B should be the same as the style of A.
  • If they then change the style of B, and create a new text layer C, the style of C should be the same as the style of B.

Here's an example. The default color is black. But after changing the style of a text layer to red, then the next text layer I create uses that red style.

NewTextStyle.mov

Implementation

I'm thinking we can make a new property of our ApplicationState, like lastEditedTextStyle: TextStyle. Any time we dispatch actions that modify a text style, we clone and then assign whatever text style we're editing to this lastEditedTextStyle.

We'll need to pass the lastEditedTextStyle into our createDrawingLayer() function in the addDrawnLayer action.