Add dirty rect parameter to Canvas.OnDraw
This commit is contained in:
Родитель
58f7014e48
Коммит
3fc91bc40b
|
@ -184,7 +184,8 @@ namespace Xwt.GtkBackend
|
|||
protected override bool OnExposeEvent (Gdk.EventExpose evnt)
|
||||
{
|
||||
Toolkit.Invoke (delegate {
|
||||
EventSink.OnDraw (CreateContext ());
|
||||
var a = evnt.Area;
|
||||
EventSink.OnDraw (CreateContext (), new Rectangle (a.X, a.Y, a.Width, a.Height));
|
||||
});
|
||||
return base.OnExposeEvent (evnt);
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ namespace Xwt.Mac
|
|||
public override void DrawRect (System.Drawing.RectangleF dirtyRect)
|
||||
{
|
||||
Toolkit.Invoke (delegate {
|
||||
eventSink.OnDraw (new ContextInfo ());
|
||||
eventSink.OnDraw (new ContextInfo (), new Rectangle (dirtyRect.X, dirtyRect.Y, dirtyRect.Width, dirtyRect.Height));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -166,7 +166,7 @@ namespace Xwt.WPFBackend
|
|||
this.wbitmap.Lock();
|
||||
|
||||
using (Graphics g = Graphics.FromImage (this.bbitmap))
|
||||
CanvasEventSink.OnDraw (new DrawingContext (g));
|
||||
CanvasEventSink.OnDraw (new DrawingContext (g), new Rectangle (0, 0, this.wbitmap.PixelWidth, this.wbitmap.PixelHeight));
|
||||
|
||||
if (this.fullRedraw || this.dirtyRects.Count == 0) {
|
||||
this.wbitmap.AddDirtyRect (new Int32Rect (0, 0, this.wbitmap.PixelWidth, this.wbitmap.PixelHeight));
|
||||
|
|
|
@ -85,7 +85,7 @@ namespace Xwt.Backends
|
|||
/// <param name='context'>
|
||||
/// Drawing context
|
||||
/// </param>
|
||||
void OnDraw (object context);
|
||||
void OnDraw (object context, Rectangle dirtyRect);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -65,7 +65,7 @@ namespace Xwt
|
|||
|
||||
protected new class WidgetBackendHost: Widget.WidgetBackendHost, ICanvasEventSink
|
||||
{
|
||||
public void OnDraw (object context)
|
||||
public void OnDraw (object context, Rectangle dirtyRect)
|
||||
{
|
||||
Context ctx = null;
|
||||
try {
|
||||
|
|
Загрузка…
Ссылка в новой задаче