NullOperator404 / Developer-Diary

Just a blog where I echo thoughts on projects, bugs, etc.
0 stars 0 forks source link

Justify Text Controls (minor issues) #3

Open NullOperator404 opened 1 year ago

NullOperator404 commented 1 year ago

The UI is finished for the bottom row text controls. A month or so ago, when laying out the UI for the text editor toolbox, I wasn't happy with the bottom row that contained the icons for "Snap-to-Center," "Layer Up/Layer Down," and text justification (left, center, right). But I needed something there as placeholders, so I just cobbled something together and pushed it back until later.

After designing controls for the Edit Art toolbox a few days ago (and being pleased with this layout), I decided to adopt the design for the text toolbox, and it worked beautifully. Both "toolboxes" share similar controls: Snap-to-center & Layer Up/Down.

So in the text toolbox, those buttons just call the JS functions I'd already written yesterday; I wrote them with the goal of making them universal so that both text and art elements could access them.

The only minor issue now is the text justification controls, which at the moment serve absolutely no purpose because the text field for user input is a <input type=text> tag, not a <textarea> tag. The latter allows for multi-line text, and thus provides a reason for the justification controls to exist.

I don't think this is a major issue, though. I just need to rewrite the HTML, tweak the CSS a bit, and a few modifications to the JS may be necessary to accommodate the different element type. After that, the text-anchor CSS attribute should handle changing the justification of text blocks on the design space.