public void InitIdentity() { // this.Init(1,0,0,1,0,0); NativeMethods.cairo_matrix_init_identity (this); }
public Matrix Fit(Gdk.Rectangle viewport) { Matrix m = new Matrix (); m.InitIdentity (); double scale = Math.Min (viewport.Width / (double) Bounds.Width, viewport.Height / (double) Bounds.Height); double x_offset = (viewport.Width - Bounds.Width * scale) / 2.0; double y_offset = (viewport.Height - Bounds.Height * scale) / 2.0; m.Translate (x_offset, y_offset); m.Scale (scale, scale); return m; }