diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-12 15:41:56 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-02-12 15:41:56 +0100 |
| commit | d6e894025ca1d21e85da60c39ccf9ed4229a6bba (patch) | |
| tree | f83a53fc11f1f41d0f4b824f01b81b6fbd8b60b2 /src/GraphicObjects/Scroller.cs | |
| parent | a3e324b2dfda42df320791b1efff1bf5217b7747 (diff) | |
debug scrolling in new Clipping system
Diffstat (limited to 'src/GraphicObjects/Scroller.cs')
| -rw-r--r-- | src/GraphicObjects/Scroller.cs | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/src/GraphicObjects/Scroller.cs b/src/GraphicObjects/Scroller.cs index 599f951f..e27eedff 100644 --- a/src/GraphicObjects/Scroller.cs +++ b/src/GraphicObjects/Scroller.cs @@ -100,6 +100,11 @@ namespace Crow : base(){} #region GraphicObject Overrides + [XmlAttributeAttribute()][DefaultValue(false)] + public override bool CacheEnabled { + get { return base.CacheEnabled; } + set { base.CacheEnabled = value; } + } void OnChildLayoutChanges (object sender, LayoutingEventArgs arg) { int maxScroll = MaximumScroll; @@ -177,17 +182,32 @@ namespace Crow savedMousePos.Y += e.YDelta; base.onMouseMove (sender, new MouseMoveEventArgs(savedMousePos.X,savedMousePos.Y,e.XDelta,e.YDelta)); } - #endregion - - public override Rectangle ContextCoordinates (Rectangle r) + public override void RegisterClip (Rectangle clip) { - return base.ContextCoordinates (r) - new Point((int)ScrollX,(int)ScrollY); + base.RegisterClip (clip - new Point((int)ScrollX,(int)ScrollY)); } + #endregion + public override Rectangle ScreenCoordinates (Rectangle r) { return base.ScreenCoordinates (r) - new Point((int)ScrollX,(int)ScrollY); } - +// protected override void onDraw (Context gr) +// { +// gr.Save (); +// //gr.ResetClip (); +// +// base.onDraw (gr); +// gr.Restore (); +// } + public override void Paint (ref Context ctx) + { + ctx.Save (); + //ctx.ResetClip (); + ctx.Translate (-ScrollX, -ScrollY); + base.Paint (ref ctx); + ctx.Restore (); + } // public override void registerClipRect () // { // HostContainer.redrawClip.AddRectangle (base.ScreenCoordinates(Slot)); |