Skip to content

Commit

Permalink
changed printStyle method of GraphicsStyle
Browse files Browse the repository at this point in the history
  • Loading branch information
daign committed Sep 6, 2023
1 parent 155d24a commit 1e3c52f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
5 changes: 3 additions & 2 deletions lib/graphicStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@ export class GraphicStyle implements IStyleDeclaration {
}

/**
* Return the style declaration as string.
* Return the concatenated style declaration as string.
* @returns The concatenated style declaration as string.
*/
public printStyle(): string {
const attributes = [];
Expand Down Expand Up @@ -457,6 +458,6 @@ export class GraphicStyle implements IStyleDeclaration {
attributes.push( `cursor: ${this.cursor}` );
}

return attributes.join( ', ' );
return attributes.join( '; ' );
}
}
2 changes: 1 addition & 1 deletion lib/styledGraphicNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export abstract class StyledGraphicNode extends GraphicNode {
// Array of points that define the element.
public points: Vector2Array = new Vector2Array();

// Class names assinged to the element.
// Class names assigned to the element.
private classNames: StringArray = new StringArray();

// Style selector object containing all class names of the element.
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@daign/2d-graphics",
"version": "1.1.5",
"version": "1.1.6",
"description": "Two dimensional graphics library that implements the daign-2d-pipeline.",
"keywords": [
"graphics",
Expand Down Expand Up @@ -47,7 +47,7 @@
"@daign/math": "^1.1.1",
"@daign/observable": "^1.1.3",
"@daign/2d-pipeline": "^1.1.1",
"@daign/style-sheets": "^1.1.0"
"@daign/style-sheets": "^1.1.1"
},
"nyc": {
"include": [
Expand Down
12 changes: 6 additions & 6 deletions test/graphicStyle.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,12 @@ describe( 'GraphicStyle', (): void => {

// Assert
expect( text ).to.equal(
`fill: black, fill-opacity: 0.9, fill-rule: evenodd, stroke: blue, stroke-width: 2, \
stroke-opacity: 0.8, stroke-linecap: square, stroke-linejoin: bevel, stroke-miterlimit: 4, \
stroke-dasharray: 1,2,3, stroke-dashoffset: 10, vector-effect: non-scaling-stroke, display: block, \
visibility: hidden, opacity: 0.7, paint-order: normal, font-family: sans-serif, font-size: 12px, \
font-style: italic, font-variant: small-caps, font-weight: bold, font-stretch: ultra-condensed, \
letter-spacing: 2px, word-spacing: 3px, text-decoration: line-through, pointer-events: fill, \
`fill: black; fill-opacity: 0.9; fill-rule: evenodd; stroke: blue; stroke-width: 2; \
stroke-opacity: 0.8; stroke-linecap: square; stroke-linejoin: bevel; stroke-miterlimit: 4; \
stroke-dasharray: 1,2,3; stroke-dashoffset: 10; vector-effect: non-scaling-stroke; display: block; \
visibility: hidden; opacity: 0.7; paint-order: normal; font-family: sans-serif; font-size: 12px; \
font-style: italic; font-variant: small-caps; font-weight: bold; font-stretch: ultra-condensed; \
letter-spacing: 2px; word-spacing: 3px; text-decoration: line-through; pointer-events: fill; \
cursor: pointer`
);
} );
Expand Down

0 comments on commit 1e3c52f

Please sign in to comment.