Skip to content
Snippets Groups Projects
Commit 1f652d5c authored by jojohoch's avatar jojohoch
Browse files

Ensure that styles of canvas elements are updated

Shift the order of style assignments in `updateStyle` method
parent a7e77ba3
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,6 @@ export abstract class CanvasElementComponent implements OnInit {
updateStyle(newProperties: Record<string, string> = {}): void {
this.style = {
...newProperties,
width: `${this.elementModel.width}px`,
height: `${this.elementModel.height}px`,
'background-color': this.elementModel.backgroundColor,
......@@ -23,7 +22,9 @@ export abstract class CanvasElementComponent implements OnInit {
'font-size': `${this.elementModel.fontSize}px`,
'font-weight': this.elementModel.bold ? 'bold' : '',
'font-style': this.elementModel.italic ? 'italic' : '',
'text-decoration': this.elementModel.underline ? 'underline' : ''
'text-decoration': this.elementModel.underline ? 'underline' : '',
...this.style,
...newProperties
};
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment