Add dirty rect argument to Canvas.OnDraw
This commit is contained in:
Родитель
a638752056
Коммит
8c1d88b215
|
@ -328,7 +328,7 @@ namespace MonoDevelop.Components.Chart
|
|||
return (((double) minTickStep) * (GetEnd (ad) - GetStart (ad))) / (double) GetAreaSize (ad);
|
||||
}
|
||||
|
||||
protected override void OnDraw (Context ctx)
|
||||
protected override void OnDraw (Context ctx, Rectangle dirtyRect)
|
||||
{
|
||||
double rwidth = Bounds.Width, rheight = Bounds.Height;
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ namespace Samples
|
|||
highlight = false;
|
||||
}
|
||||
|
||||
protected override void OnDraw (Context ctx)
|
||||
protected override void OnDraw (Context ctx, Rectangle dirtyRect)
|
||||
{
|
||||
ctx.SetColor (new Color (0.5, 0.5, 0.5));
|
||||
ctx.Rectangle (Bounds);
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace Samples
|
|||
AddChild (box, new Rectangle (30, 70, 100, 30));
|
||||
}
|
||||
|
||||
protected override void OnDraw (Xwt.Drawing.Context ctx)
|
||||
protected override void OnDraw (Xwt.Drawing.Context ctx, Rectangle dirtyRect)
|
||||
{
|
||||
ctx.Rectangle (0, 0, Bounds.Width, Bounds.Height);
|
||||
var g = new LinearGradient (0, 0, Bounds.Width, Bounds.Height);
|
||||
|
|
|
@ -32,9 +32,9 @@ namespace Samples
|
|||
{
|
||||
public class DrawingFigures: Drawings
|
||||
{
|
||||
protected override void OnDraw (Context ctx)
|
||||
protected override void OnDraw (Context ctx, Rectangle dirtyRect)
|
||||
{
|
||||
base.OnDraw (ctx);
|
||||
base.OnDraw (ctx, dirtyRect);
|
||||
Figures (ctx, 5, 5);
|
||||
}
|
||||
|
||||
|
|
|
@ -32,9 +32,9 @@ namespace Samples
|
|||
{
|
||||
public class DrawingPatternsAndImages: Drawings
|
||||
{
|
||||
protected override void OnDraw (Context ctx)
|
||||
protected override void OnDraw (Context ctx, Rectangle dirtyRect)
|
||||
{
|
||||
base.OnDraw (ctx);
|
||||
base.OnDraw (ctx, dirtyRect);
|
||||
PatternsAndImages (ctx, 5, 5);
|
||||
}
|
||||
|
||||
|
@ -83,15 +83,15 @@ namespace Samples
|
|||
|
||||
// Setting pixels
|
||||
|
||||
ib = new ImageBuilder (50, 50);
|
||||
img = ib.ToImage ();
|
||||
ctx.SetLineWidth (1);
|
||||
for (int i=0; i<50;i++) {
|
||||
for (var j=0; j<50;j++) {
|
||||
img.SetPixel (i,j, Color.FromHsl (0.5, (double)i / 50d, (double)j / 50d));
|
||||
Color c = Color.FromHsl (0.5, (double)i / 50d, (double)j / 50d);
|
||||
ctx.Rectangle (i, j, 1, 1);
|
||||
ctx.SetColor (c);
|
||||
ctx.Fill ();
|
||||
}
|
||||
}
|
||||
|
||||
ctx.DrawImage (img, 0, y + 110);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,9 +32,9 @@ namespace Samples
|
|||
{
|
||||
public class DrawingText: Drawings
|
||||
{
|
||||
protected override void OnDraw (Context ctx)
|
||||
protected override void OnDraw (Context ctx, Rectangle dirtyRect)
|
||||
{
|
||||
base.OnDraw (ctx);
|
||||
base.OnDraw (ctx, dirtyRect);
|
||||
Texts (ctx, 5, 5);
|
||||
}
|
||||
|
||||
|
|
|
@ -40,9 +40,9 @@ namespace Samples
|
|||
|
||||
public class DrawingTransforms: Canvas
|
||||
{
|
||||
protected override void OnDraw (Context ctx)
|
||||
protected override void OnDraw (Context ctx, Rectangle dirtyRect)
|
||||
{
|
||||
base.OnDraw (ctx);
|
||||
base.OnDraw (ctx, dirtyRect);
|
||||
Transforms (ctx, 5, 5);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace Samples
|
|||
|
||||
class MyWidget: Canvas
|
||||
{
|
||||
protected override void OnDraw (Context ctx)
|
||||
protected override void OnDraw (Context ctx, Rectangle dirtyRect)
|
||||
{
|
||||
ctx.SetLineWidth (5);
|
||||
ctx.SetColor (new Color (1.0f, 0f, 0.5f));
|
||||
|
|
|
@ -47,9 +47,9 @@ namespace Samples
|
|||
img = Image.FromResource (GetType (), "cow.jpg");
|
||||
}
|
||||
|
||||
protected override void OnDraw (Context ctx)
|
||||
protected override void OnDraw (Context ctx, Rectangle dirtyRect)
|
||||
{
|
||||
base.OnDraw (ctx);
|
||||
base.OnDraw (ctx, dirtyRect);
|
||||
|
||||
for (int y = 0; y < img.Size.Height / 50; ++y) {
|
||||
for (int x = 0; x < img.Size.Width / 50; ++x) {
|
||||
|
|
|
@ -88,7 +88,7 @@ namespace Samples
|
|||
MinHeight = 100;
|
||||
}
|
||||
|
||||
protected override void OnDraw (Context ctx)
|
||||
protected override void OnDraw (Context ctx, Rectangle dirtyRect)
|
||||
{
|
||||
ctx.Translate (-hscroll.Value, -vscroll.Value);
|
||||
ctx.Rectangle (new Rectangle (0, 0, imageSize, imageSize));
|
||||
|
|
|
@ -70,7 +70,7 @@ namespace Xwt
|
|||
Context ctx = null;
|
||||
try {
|
||||
ctx = new Context (context);
|
||||
((Canvas)Parent).OnDraw (ctx);
|
||||
((Canvas)Parent).OnDraw (ctx, dirtyRect);
|
||||
}
|
||||
finally {
|
||||
ctx.Dispose ();
|
||||
|
@ -246,7 +246,7 @@ namespace Xwt
|
|||
/// <param name='ctx'>
|
||||
/// Drawing context
|
||||
/// </param>
|
||||
protected virtual void OnDraw (Context ctx)
|
||||
protected virtual void OnDraw (Context ctx, Rectangle dirtyRect)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче