Skip to content

Line Height Simplified

Jabier Arraiza requested to merge lineHeightUnits into master

UX explain of how branch work

This MR about simplifying line height is based on:

  • Line height is well rendered in all possible cases, this is not the scope of this branch, focused in UX.
  • Whithin Inkscape we can limit the scope in edit mode to simplify UI

So we have 5 status of selections:

  1. Multiple text element selected
  2. One text element selected
  3. One text element selected and focusin (propmpt) without subselection
  4. One text element with all content subselected
  5. One text element partialy subselected

I apply a grouping in, by one side the status that apply outer and the other the status than apply inner

OUTER: 1,2,3,4

INNER: 5

In function the grouping mode (outer or inner) we process the line height submited by the user in a diferent way. Also we show the value in the toolbar in function of the selection.

User change line height or units in OUTER mode:

All children of the text/s change his line height to 0 and text element (outer) get the value set by the user.

User change line height in INNER mode:

Here we need a bit calculation when editing line height values: A: We store the current outer value, this value is the minimun value to all childrens B: We put the user input into the sub-selected, not sub-selected items keep unchanged except his line height is lower than A (we use A tor them)

There is a special thing to note, in the same "line" can be multiples elements but the line height for the whole is the maximun value, so in this branch we remove the nested childrens line heigh and add line height to root children only (the line).

This allow us to have only 2 widgets to define line height:

  • Ammount
  • Unit

This branch also add a new widget with font size unit.
This branch also make sub-selections using canvas as event handler instead the text element this allow a smooth and not stop subselections

Edited by Jabier Arraiza

Merge request reports