diff --git a/ChangeLog b/ChangeLog index 1940c4b7d..8f521d7fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-05-06 John Luke + + * pango/Makefile.am: add Matrix.custom + * pango/Matrix.custom: add Pango.Matrix.Identity field + which is the equivalent of PANGO_MATRIX_INIT + * sample/GtkDemo/DemoRotatedText.cs: use Pango.Matrix.Identity + * doc/en/Pango/Matrix.xml: add docs for Pango.Matrix.Identity + 2005-05-06 Mike Kestner * configure.in.in : always enable debug build in maintainer_mode. diff --git a/doc/en/Pango/Matrix.xml b/doc/en/Pango/Matrix.xml index db70b67e3..b5cca8e8e 100644 --- a/doc/en/Pango/Matrix.xml +++ b/doc/en/Pango/Matrix.xml @@ -227,5 +227,18 @@ To be added + + + Field + + Pango.Matrix + + + + + Can be used to initialize a PangoMatrix to the identity transform. + This is the equivalent of PANGO_MATRIX_INIT in C. + + - \ No newline at end of file + diff --git a/pango/Makefile.am b/pango/Makefile.am index 1e0b26103..bebbb56a1 100644 --- a/pango/Makefile.am +++ b/pango/Makefile.am @@ -38,6 +38,7 @@ customs = \ GlyphItem.custom \ Layout.custom \ LayoutLine.custom \ + Matrix.custom \ TabArray.custom add_dist = makefile.win32 diff --git a/pango/Matrix.custom b/pango/Matrix.custom new file mode 100644 index 000000000..8c84561fc --- /dev/null +++ b/pango/Matrix.custom @@ -0,0 +1,34 @@ +// Pango.Matrix.custom - Pango Matrix class customizations +// +// Authors: John Luke +// +// Copyright (c) 2005 John Luke. +// +// This code is inserted after the automatically generated code. +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of version 2 of the Lesser GNU General +// Public License as published by the Free Software Foundation. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this program; if not, write to the +// Free Software Foundation, Inc., 59 Temple Place - Suite 330, +// Boston, MA 02111-1307, USA. + + static Matrix () + { + Identity.Xx = 1.0; + Identity.Xy = 0.0; + Identity.Yx = 0.0; + Identity.Yy = 1.0; + Identity.X0 = 0.0; + Identity.Y0 = 0.0; + } + + public static Matrix Identity; + diff --git a/sample/GtkDemo/DemoRotatedText.cs b/sample/GtkDemo/DemoRotatedText.cs index cdef02de4..4b05b286b 100644 --- a/sample/GtkDemo/DemoRotatedText.cs +++ b/sample/GtkDemo/DemoRotatedText.cs @@ -44,14 +44,7 @@ namespace GtkDemo // the centered square where we draw are [-RADIUS, RADIUS], [-RADIUS, RADIUS] // We first center, then change the scale deviceRadius = Math.Min (width, height) / 2; - // #define PANGO_MATRIX_INIT { 1., 0., 0., 1., 0., 0. } - Matrix matrix = new Matrix (); - matrix.Xx = 1.0; - matrix.Xy = 0.0; - matrix.Yx = 0.0; - matrix.Yy = 1.0; - matrix.X0 = 0.0; - matrix.Y0 = 0.0; + Matrix matrix = Pango.Matrix.Identity; matrix.Translate (deviceRadius + (width - 2 * deviceRadius) / 2, deviceRadius + (height - 2 * deviceRadius) / 2); matrix.Scale (deviceRadius / RADIUS, deviceRadius / RADIUS);