Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
Co-authored-by: Lukas Radermacher <49586507+lukasrad02@users.noreply.github.com>
  • Loading branch information
Greenscreen23 and lukasrad02 committed Jun 16, 2022
1 parent 872b57c commit ddd0672
Show file tree
Hide file tree
Showing 49 changed files with 170 additions and 93 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
building
addCircleTestSVGTo: aSVGCompositeMorph

|circle|
circle := SVGCircleMorph new.
aSVGCompositeMorph addMorph: circle.
^ circle
rectangle: self defaultCircleRectangle;
transform: self defaultTransform;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
building
addEllipseTestSVGTo: aSVGCompositeMorph

|ellipse|
ellipse := SVGEllipseMorph new.
aSVGCompositeMorph addMorph: ellipse.
^ ellipse
rectangle: self defaultEllipseRectangle;
transform: self defaultTransform;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
building
addGroupTestSVGTo: aSVGCompositeMorph

|group|
group := SVGGroupMorph new.
aSVGCompositeMorph addMorph: group.
^ group
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
building
addLineTestSVGTo: aSVGCompositeMorph

|line|
line := SVGLineMorph new.
aSVGCompositeMorph addMorph: line.
line
rectangle: self defaultLineRectangle;
transform: self defaultTransform.
line style
at: 'stroke' put: self defaultStrokeColor;
at: 'stroke-width' put: self defaultStrokeWidth.
^ line
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
building
addRectangleTestSVGTo: aSVGCompositeMorph

|rect|
rect := SVGRectMorph new.
aSVGCompositeMorph addMorph: rect.
^ rect
rectangle: self defaultRectRectangle;
transform: self defaultTransform;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
building
addTSpanTestSVGTo: aSVGTextMorph

|tSpan|
tSpan := SVGTSpanMorph new.
aSVGTextMorph addMorph: tSpan.
^ tSpan
text: self defaultText;
location: tSpan owner location;
transform: self defaultTransform;
yourself
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
building
addTextTestSVGTo: aSVGCompositeMorph

|text|
text := SVGTextMorph new.
aSVGCompositeMorph addMorph: text.
^ text
text: self defaultText;
location: self defaultLocation;
transform: self defaultTransform;
yourself

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resources
resources - svg strings
circleTestSVGString

^ '<svg width="200" height="200" version="1.1" xmlns="http://www.w3.org/2000/svg">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
default values
defaultCircleRectangle

^ 25 @ 25 extent: 50 @ 50
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
default values
defaultEllipseRectangle

^ 15 @ 25 extent: 70 @ 50
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
default values
defaultLineRectangle

^ 10 @ 10 extent: 80 @ 80
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
default values
defaultLocation

^ 20 @ 20
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
default values
defaultRectRectangle

^ 25 @ 15 extent: 50 @ 70
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
default values
defaultSVGBounds

^ 0 @ 0 extent: 100 @ 100
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
default values
defaultStrokeColor

^ Color red
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
default values
defaultStrokeWidth

^ 5.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
default values
defaultText

^ 'Hi, I''m a teapot'
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
default values
defaultTransform

^ MatrixTransform2x3 identity

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resources
resources - svg strings
ellipseTestSVGString

^ '<svg height="200" version="1.1" width="200" xmlns="http://www.w3.org/2000/svg">
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resources
resources - svg strings
groupTestSVGString

^ '<svg width="200" height="200" version="1.1" xmlns="http://www.w3.org/2000/svg">
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resources
resources - svg strings
lineTestSVGString

^ '<svg height="200" version="1.1" width="200" xmlns="http://www.w3.org/2000/svg">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
building
morphTestSVG

|morph|
morph := SVGMorph new
bounds: self defaultSVGBounds;
transform: self defaultTransform;
yourself.
morph renderer styleIn: morph fromSVGStyle: morph style.
^ morph

Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
resources
building
pathTestSVG

^ '<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
<path d="M10 10"/>
</svg>'
^ nil
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resources
resources - svg strings
pathTestSVGString

^ '<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
resources
building
polygonTestSVG

^ '<svg width="120" height="120" viewBox="0 0 120 120"
xmlns="http://www.w3.org/2000/svg">
<polygon points="60,20 100,40 100,80 60,100 20,80 20,40"/>
</svg>'
^ nil
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resources
resources - svg strings
polygonTestSVGString

^ '<svg width="120" height="120" viewBox="0 0 120 120"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
resources
building
polylineTestSVG

^ '<svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg">
<polyline points="0,100 50,25 50,75 100,0" />
</svg>'
^ nil
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resources
resources - svg strings
polylineTestSVGString

^ '<svg viewBox="0 0 200 100" xmlns="http://www.w3.org/2000/svg">
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resources
resources - svg strings
rectangleTestSVGString

^ '<svg width="200" height="200" version="1.1" xmlns="http://www.w3.org/2000/svg">
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resources
resources - svg strings
tSpanTestSVGString

^ '<svg viewBox="0 0 240 40" xmlns="http://www.w3.org/2000/svg">
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
resources
resources - svg strings
textTestSVGString

^ '<svg height="200" version="1.1" width="200" xmlns="http://www.w3.org/2000/svg">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
building
wantsToTestSVG - from string
wantsToTestCircle

self wantsToTest: (SVGMorph fromString: self circleTestSVGString)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
building
wantsToTestSVG - from string
wantsToTestEllipse

self wantsToTest: (SVGMorph fromString: self ellipseTestSVGString)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
building
wantsToTestSVG - from string
wantsToTestGroup

self wantsToTest: (SVGMorph fromString: self groupTestSVGString)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
building
wantsToTestSVG - from string
wantsToTestLine

self wantsToTest: (SVGMorph fromString: self lineTestSVGString)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
building
wantsToTestSVG - from string
wantsToTestPath

self wantsToTest: (SVGMorph fromString: self pathTestSVGString)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
building
wantsToTestSVG - from string
wantsToTestPolygon

self wantsToTest: (SVGMorph fromString: self polygonTestSVGString)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
building
wantsToTestSVG - from string
wantsToTestPolyline

self wantsToTest: (SVGMorph fromString: self polylineTestSVGString)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
building
wantsToTestSVG - from string
wantsToTestRectangle

self wantsToTest: (SVGMorph fromString: self rectangleTestSVGString)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
building
wantsToTestSVG - from string
wantsToTestTSpan

self wantsToTest: (SVGMorph fromString: self tSpanTestSVGString)
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
building
wantsToTestSVG - from string
wantsToTestText

self wantsToTest: (SVGMorph fromString: self textTestSVGString)
Loading

0 comments on commit ddd0672

Please sign in to comment.