Skip to content

Commit

Permalink
Merge commit 'acca5529f28e78e0f4663c837a74c63091f7f717'
Browse files Browse the repository at this point in the history
# Conflicts:
#	package.json
#	src/Document/Element.ts
#	src/Document/TextElement.ts
  • Loading branch information
HackbrettXXX committed Sep 24, 2024
2 parents b7985a9 + acca552 commit a22564c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@yworks/canvg",
"version": "3.0.10",
"name": "canvg",
"version": "3.0.9",
"description": "JavaScript SVG parser and renderer on Canvas.",
"authors": [
{
Expand Down
6 changes: 2 additions & 4 deletions src/Document/Element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,9 +315,7 @@ export default abstract class Element {
});
}

public isFirstChild(): boolean {
const parent = this.parent;

return Boolean(parent) && parent.children.indexOf(this) === 0;
isFirstChild() {
return this.parent?.children.indexOf(this) === 0;
}
}
3 changes: 2 additions & 1 deletion src/Document/TextElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,6 @@ export default class TextElement extends RenderedElement {
* Inherits positional attributes from {@link TextElement} parent(s). Attributes
* are only inherited from a parent to its first child.
* @param name - The attribute name.
* @protected
* @returns The attribute value or null.
*/
protected getInheritedAttribute(name: string): string | null {
Expand All @@ -573,8 +572,10 @@ export default class TextElement extends RenderedElement {
if (parentAttr.hasValue(true)) {
return parentAttr.getValue('0');
}

current = current.parent;
}

return null;
}
}

0 comments on commit a22564c

Please sign in to comment.