Exemple #1
0
func (s TAGTestsSuite) Test_Transform(c *C) {
	//c.Skip("Not now")

	obtained := cSL(`<g x="1" transform="matrix(12.00, 34.00, 45.00, 34.50, 212.00, 4.45)"/>`)

	st := transform.Transform().Matrix(12, 34, 45, 34.5, 212, 4.45)
	l := Tag("g", date_tag_list).Transform(st)
	c.Assert(cSL(l.Source()), Equals, obtained)
}
Exemple #2
0
func (s GROUPTestsSuite) Test_Transform(c *C) {
	//c.Skip("Not now")
	obtained := cSL(`<g transform="matrix(12.00, 34.00, 45.00, 34.50, 212.00, 4.45)"><title>WWW</title></g>`)

	l := Group()
	st := transform.Transform().Matrix(12, 34, 45, 34.5, 212, 4.45)
	l = l.Transform(st).Append(Title("WWW"))
	c.Assert(cSL(l.Source()), Equals, obtained)
}
Exemple #3
0
func (s USETestsSuite) Test_Transform(c *C) {
	// c.Skip("Not now")

	obtained := cSL(`<use xlink:href="#MySymbol" transform="matrix(12.00, 34.00, 45.00, 34.50, 212.00, 4.45)" ><title>WWW</title></use>`)

	l := Use().Href(`#MySymbol`)
	st := transform.Transform().Matrix(12, 34, 45, 34.5, 212, 4.45)
	l = l.Transform(st).Append(Title("WWW"))
	c.Assert(cSL(l.Source()), Equals, obtained)
}
Exemple #4
0
func (s LINETestsSuite) Test_Transform(c *C) {
	//c.Skip("Not now")

	obtained := cSL(`<line x1="1" y1="2" x2="3" y2="4" transform="matrix(12.00, 34.00, 45.00, 34.50, 212.00, 4.45)" ><title>WWW</title></line>`)

	l := Line(1, 2, 3, 4)
	st := transform.Transform().Matrix(12, 34, 45, 34.5, 212, 4.45)
	l = l.Transform(st).Append(Title("WWW"))
	c.Assert(cSL(l.Source()), Equals, obtained)
}
Exemple #5
0
func (s PATHTestsSuite) Test_Transform(c *C) {
	// c.Skip(`Not now")

	p := Path()
	p = p.M(0, 0).L(100, 200)
	st := transform.Transform().Matrix(12, 34, 45, 34.5, 212, 4.45)
	p = p.Transform(st).Append(Title(`WWW`))
	obtained := cSL(`<path d="M0,0 L100,200" transform="matrix(12.00, 34.00, 45.00, 34.50, 212.00, 4.45)">
<title>WWW</title></path>`)

	c.Assert(cSL(p.Source()), Equals, obtained)
}
Exemple #6
0
func (s POLYLINETestsSuite) Test_Transform(c *C) {
	//c.Skip("Not now")

	obtained := cSL(`<polyline points="1.1,2.22 3.3,4" transform="matrix(12.00, 34.00, 45.00, 34.50, 212.00, 4.45)">
<title>WWW</title>
</polyline>`)

	l := Polyline().Points(1.1, 2.22, 3.30, 4)
	st := transform.Transform().Matrix(12, 34, 45, 34.5, 212, 4.45)
	l = l.Transform(st).Append(Title("WWW"))
	c.Assert(cSL(l.Source()), Equals, obtained)
}
Exemple #7
0
func (s TEXTTestsSuite) Test_Transform(c *C) {
	//c.Skip("Not now")

	obtained := cSL(`<text x="250" y="150" style="font-family:Verdana;font-size:55;fill:blue" transform="matrix(12.00, 34.00, 45.00, 34.50, 212.00, 4.45)">Hello, out there</text>`)
	f := style.Font("font-family:Verdana;font-size:55")
	text := Text(style.Style().Fill("blue").Font(f))
	text = text.XY(250, 150).String("Hello, out there")
	tr := transform.Transform().Matrix(12, 34, 45, 34.5, 212, 4.45)
	text = text.Transform(tr)
	res := text.Source()
	c.Assert(cSL(res), Equals, obtained)
}
Exemple #8
0
func (s RECTTestsSuite) Test_Transform(c *C) {
	//c.Skip("Not now")

	obtained := cSL(`<rect height="4" width="3" x="1" y="2" transform="matrix(12.00, 34.00, 45.00, 34.50, 212.00, 4.45)">
<title>WWW</title>
</rect>`)

	l := Rect(1, 2, 3, 4)
	st := transform.Transform().Matrix(12, 34, 45, 34.5, 212, 4.45)
	l = l.Transform(st).Append(Title("WWW"))
	c.Assert(cSL(l.Source()), Equals, obtained)
}