Browse Source

Merge branch 'fix-cairo-transform' into feat-cairo-geometry

pull/59/head
ncarrillo 12 years ago
parent
commit
ced52853c4
  1. 10
      Cairo/Perspex.Cairo/Media/DrawingContext.cs

10
Cairo/Perspex.Cairo/Media/DrawingContext.cs

@ -214,11 +214,10 @@ namespace Perspex.Cairo.Media
/// <returns>A disposable used to undo the clip rectangle.</returns> /// <returns>A disposable used to undo the clip rectangle.</returns>
public IDisposable PushClip(Rect clip) public IDisposable PushClip(Rect clip)
{ {
this.context.Save();
this.context.Rectangle(clip.ToCairo()); this.context.Rectangle(clip.ToCairo());
this.context.Clip(); this.context.Clip();
return Disposable.Create(() => this.context.Restore()); return Disposable.Create(() => this.context.ResetClip());
} }
/// <summary> /// <summary>
@ -228,14 +227,11 @@ namespace Perspex.Cairo.Media
/// <returns>A disposable used to undo the transformation.</returns> /// <returns>A disposable used to undo the transformation.</returns>
public IDisposable PushTransform(Matrix matrix) public IDisposable PushTransform(Matrix matrix)
{ {
this.context.Save();
this.context.Transform(matrix.ToCairo()); this.context.Transform(matrix.ToCairo());
this.CurrentTransform *= matrix;
return Disposable.Create(() => return Disposable.Create(() =>
{ {
this.context.Restore(); this.context.Transform(matrix.Invert().ToCairo());
this.CurrentTransform *= matrix.Invert();
}); });
} }

Loading…
Cancel
Save