diff options
| -rwxr-xr-x | Tests/Interfaces/test0.goml | 4 | ||||
| -rw-r--r-- | src/GraphicObjects/GraphicObject.cs | 9 |
2 files changed, 10 insertions, 3 deletions
diff --git a/Tests/Interfaces/test0.goml b/Tests/Interfaces/test0.goml index f0b78d14..d8ff1027 100755 --- a/Tests/Interfaces/test0.goml +++ b/Tests/Interfaces/test0.goml @@ -1,2 +1,4 @@ <?xml version="1.0"?> -<GraphicObject Width="200" Background="Green"/> +<Container Width="300" Height="300" Background="Red"> + <GraphicObject Width="200" Height="200" Background="Green"/> +</Container> diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index e54f4b12..9d88cea1 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -764,6 +764,10 @@ namespace go #endif
using (Context gr = new Context (draw)) {
gr.Antialias = Antialias.Subpixel;
+ gr.Operator = Operator.Source;
+ gr.SetSourceRGBA(0,0,0,0);
+ gr.Paint();
+ gr.Operator = Operator.Over;
onDraw (gr);
}
draw.Flush ();
@@ -787,10 +791,10 @@ namespace go #if CAIRO_GL
using (Surface source = new GLSurface
- (device, Content.ColorAlpha, texID, rb.Width, rb.Height)) {
+ (device, Content.ColorAlpha, texID, Slot.Width, Slot.Height)) {
#else
using (Surface source =
- new ImageSurface(bmp, Format.Argb32, rb.Width, rb.Height, 4 * Slot.Width)) {
+ new ImageSurface(bmp, Format.Argb32, Slot.Width, Slot.Height, 4 * Slot.Width)) {
#endif
if (this.Background == Color.Clear) {
ctx.Save ();
@@ -801,6 +805,7 @@ namespace go }
ctx.SetSourceSurface (source, rb.X, rb.Y);
ctx.Paint ();
+ source.Flush();
}
}
|