Skip to content

Commit

Permalink
Use cascades if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasrad02 committed Aug 5, 2022
1 parent b59125d commit d9d5554
Show file tree
Hide file tree
Showing 12 changed files with 49 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ applyCommonAttributesOf: aMorph on: anXMLElement

aMorph id
ifNotNil: [anXMLElement attributeAt: 'id' put: aMorph id].
self applyStyleOf: aMorph on: anXMLElement.
self applyTransformOf: aMorph on: anXMLElement
self
applyStyleOf: aMorph on: anXMLElement;
applyTransformOf: aMorph on: anXMLElement
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ visitSVGCircle: aCircle
|element|
element := SVGXMLElement new.

self applyCommonAttributesOf: aCircle on: element.
self applyCircleAttributesOf: aCircle on: element.
self
applyCommonAttributesOf: aCircle on: element;
applyCircleAttributesOf: aCircle on: element.

^ element
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ visitSVGEllipse: anEllipse
|element|
element := SVGXMLElement new.

self applyCommonAttributesOf: anEllipse on: element.
self applyEllipseAttributesOf: anEllipse on: element.
self
applyCommonAttributesOf: anEllipse on: element;
applyEllipseAttributesOf: anEllipse on: element.

^ element
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ visitSVGGroup: aGroup
|element|
element := SVGXMLElement new.

self applyCommonAttributesOf: aGroup on: element.
self applyGroupAttributesOf: aGroup on: element.
self addSubmorphsOf: aGroup to: element.
self
applyCommonAttributesOf: aGroup on: element;
applyGroupAttributesOf: aGroup on: element;
addSubmorphsOf: aGroup to: element.

^ element
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ visitSVGLine: aLine
|element|
element := SVGXMLElement new.

self applyCommonAttributesOf: aLine on: element.
self applyLineAttributesOf: aLine on: element.
self
applyCommonAttributesOf: aLine on: element;
applyLineAttributesOf: aLine on: element.

^ element
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
visiting
visitSVGMorph: aMorph

self applyCommonAttributesOf: aMorph on: self document.
self applySVGAttributesOf: aMorph on: self document.
self serializeGradientsOf: aMorph on: self document.
self addSubmorphsOf: aMorph to: self document
self
applyCommonAttributesOf: aMorph on: self document;
applySVGAttributesOf: aMorph on: self document;
serializeGradientsOf: aMorph on: self document;
addSubmorphsOf: aMorph to: self document
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ visitSVGPath: aPath
|element|
element := SVGXMLElement new.

self applyCommonAttributesOf: aPath on: element.
self applyPathAttributesOf: aPath on: element.
self
applyCommonAttributesOf: aPath on: element;
applyPathAttributesOf: aPath on: element.

^ element
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ visitSVGPolygonal: aPolygonal
|element|
element := SVGXMLElement new.

self applyCommonAttributesOf: aPolygonal on: element.
self applyPolygonalAttributesOf: aPolygonal on: element.
self
applyCommonAttributesOf: aPolygonal on: element;
applyPolygonalAttributesOf: aPolygonal on: element.

^ element
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ visitSVGRectangle: aRectangle
|element|
element := SVGXMLElement new.

self applyCommonAttributesOf: aRectangle on: element.
self applyRectangleAttributesOf: aRectangle on: element.
self
applyCommonAttributesOf: aRectangle on: element;
applyRectangleAttributesOf: aRectangle on: element.

^ element
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ visitSVGTSpan: aTSpan
|element|
element := SVGXMLElement new.

self applyCommonAttributesOf: aTSpan on: element.
self applyTSpanAttributesOf: aTSpan on: element.
self serializeTextChildren: aTSpan on: element.
self
applyCommonAttributesOf: aTSpan on: element;
applyTSpanAttributesOf: aTSpan on: element;
serializeTextChildren: aTSpan on: element.

^ element
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ visitSVGText: aText
|element|
element := SVGXMLElement new.

self applyCommonAttributesOf: aText on: element.
self applyTextAttributesOf: aText on: element.
self serializeTextChildren: aText on: element.
self
applyCommonAttributesOf: aText on: element;
applyTextAttributesOf: aText on: element;
serializeTextChildren: aText on: element.

^ element
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"instance" : {
"addSubmorphsOf:to:" : "aes 5/23/2022 12:14",
"applyCircleAttributesOf:on:" : "lra 6/12/2022 16:44",
"applyCommonAttributesOf:on:" : "aes 5/23/2022 12:08",
"applyCommonAttributesOf:on:" : "lra 8/5/2022 16:21",
"applyEllipseAttributesOf:on:" : "lra 6/12/2022 16:45",
"applyGroupAttributesOf:on:" : "aes 5/23/2022 12:13",
"applyLineAttributesOf:on:" : "aes 5/23/2022 12:15",
Expand All @@ -26,15 +26,15 @@
"serializeGradientsOf:on:" : "aes 6/19/2022 14:30",
"serializeTextChildren:on:" : "aes 5/23/2022 16:36",
"urlForGradient:" : "aes 6/19/2022 14:12",
"visitSVGCircle:" : "lra 5/28/2022 12:16",
"visitSVGEllipse:" : "lra 5/28/2022 12:16",
"visitSVGGroup:" : "lra 5/28/2022 12:16",
"visitSVGLine:" : "lra 5/28/2022 12:17",
"visitSVGMorph:" : "aes 6/19/2022 14:04",
"visitSVGPath:" : "lra 5/28/2022 12:17",
"visitSVGCircle:" : "lra 8/5/2022 16:22",
"visitSVGEllipse:" : "lra 8/5/2022 16:22",
"visitSVGGroup:" : "lra 8/5/2022 16:22",
"visitSVGLine:" : "lra 8/5/2022 16:22",
"visitSVGMorph:" : "lra 8/5/2022 16:23",
"visitSVGPath:" : "lra 8/5/2022 16:23",
"visitSVGPolygon:" : "aes 5/23/2022 12:25",
"visitSVGPolygonal:" : "lra 5/28/2022 12:17",
"visitSVGPolygonal:" : "lra 8/5/2022 16:23",
"visitSVGPolyline:" : "aes 5/23/2022 12:25",
"visitSVGRectangle:" : "lra 5/28/2022 12:17",
"visitSVGTSpan:" : "lra 5/28/2022 12:17",
"visitSVGText:" : "lra 5/28/2022 12:17" } }
"visitSVGRectangle:" : "lra 8/5/2022 16:23",
"visitSVGTSpan:" : "lra 8/5/2022 16:23",
"visitSVGText:" : "lra 8/5/2022 16:24" } }

0 comments on commit d9d5554

Please sign in to comment.