Andrei486 / uml-diagram-collab

0 stars 0 forks source link

Changes so that text styles save correctly #114

Closed Andrei486 closed 6 months ago

Andrei486 commented 6 months ago

This is a separate branch because of the changes that were made to the command.

When multiple size/fontFamily commands were run in rapid succession, which occurs during loading, the getFont() method will not retrieve the label's most current font, as modified by previous commands. This leads to some size/fontFamily commands being overwritten by the previous font size or family, when both types of commands exist. This is fixed by using regex to search through the element's style to find the font size/family. If none is found, we find the font size or family as previously, but since the style updates instantly (even if it may not be applied to the font yet) this supports commands being run quickly.

The rest of the changes are standard: adding the command factory where it needs to be and updating the command list compressor with new logic (and some Javadocs).