The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Makefile

These changes was commited to the Birdfont repository Thu, 14 Jul 2016 12:29:26 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Thu, 14 Jul 2016 12:29:26 +0000 (14:29 +0200)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Thu, 14 Jul 2016 12:29:26 +0000 (14:29 +0200)
commit 33b640bfddc1dedfb34352dd22fb278d002e88d0
tree b3f0159e6c897e7cfb799fcc4cbdd09470d88d7f
parent 0231f8f4517777e8db3519def3ee894884b57b9b
Makefile

Makefile [new ]
libsvgbird/SvgTransforms.vala
diff --git Makefile(new)
--- /dev/null +++ b/Makefile @@ -1,1 +1,7 @@ + all: + ./configure + ./build.py + + install: + ./install.py -d $(DESTDIR)
--- a/libsvgbird/SvgTransforms.vala +++ b/libsvgbird/SvgTransforms.vala @@ -25,6 +25,8 @@ public double total_rotation = 0; public double scale_x = 1; public double scale_y = 1; + public double translate_x = 0; + public double translate_y = 0; public SvgTransforms () { transforms = new Gee.ArrayList<SvgTransform> (); @@ -33,6 +35,11 @@ } public void collapse_transforms () { + Matrix translate_matrix = Matrix.identity (); + translate_matrix.translate (translate_x, translate_y); + SvgTransform translate_transform = new SvgTransform.for_matrix (translate_matrix); + add (translate_transform); + SvgTransform rotation_transform = new SvgTransform.for_matrix (rotation_matrix); add (rotation_transform); @@ -61,6 +68,14 @@ size_matrix = Matrix.identity (); scale_x = 1; scale_y = 1; + + translate_x = 0; + translate_y = 0; + } + + public void translate (double x, double y) { + translate_x += x; + translate_y += y; } public void rotate (double theta, double x, double y) { @@ -125,6 +140,7 @@ transformation_matrix.multiply (transformation_matrix, part); } + transformation_matrix.translate (translate_x, translate_y); transformation_matrix.multiply (transformation_matrix, size_matrix); transformation_matrix.multiply (transformation_matrix, rotation_matrix);