mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 07:47:54 +01:00
Updated the OnDrawingContent method across multiple classes to accept a DrawContext? context parameter, replacing the parameterless version. This change standardizes the drawing API and enables context-aware drawing operations.
The refactor includes: - Modifying method signatures in classes like `AnimationScenario`, `Images`, `DrawingArea`, `AttributeView`, `Snake`, and others. - Removing the parameterless `OnDrawingContent` method from the `View` class. - Updating calls to the base class implementation to pass the `context` parameter. - Adjusting comments and documentation to reflect the new method signature. This change ensures consistency and prepares the codebase for more advanced drawing capabilities.
This commit is contained in:
@@ -173,7 +173,7 @@ public class AnimationScenario : Scenario
|
||||
private Rectangle _oldSize = Rectangle.Empty;
|
||||
public void NextFrame () { _currentFrame = (_currentFrame + 1) % _frameCount; }
|
||||
|
||||
protected override bool OnDrawingContent ()
|
||||
protected override bool OnDrawingContent (DrawContext? context)
|
||||
{
|
||||
if (_frameCount == 0)
|
||||
{
|
||||
|
||||
@@ -631,7 +631,7 @@ public class Images : Scenario
|
||||
public Image<Rgba32> FullResImage;
|
||||
private Image<Rgba32> _matchSize;
|
||||
|
||||
protected override bool OnDrawingContent ()
|
||||
protected override bool OnDrawingContent (DrawContext? context)
|
||||
{
|
||||
if (FullResImage == null)
|
||||
{
|
||||
@@ -708,7 +708,7 @@ public class Images : Scenario
|
||||
return (columns, rows);
|
||||
}
|
||||
|
||||
protected override bool OnDrawingContent ()
|
||||
protected override bool OnDrawingContent (DrawContext? context)
|
||||
{
|
||||
if (_palette == null || _palette.Count == 0)
|
||||
{
|
||||
|
||||
@@ -273,7 +273,7 @@ public class DrawingArea : View
|
||||
public ITool CurrentTool { get; set; } = new DrawLineTool ();
|
||||
public DrawingArea () { AddLayer (); }
|
||||
|
||||
protected override bool OnDrawingContent ()
|
||||
protected override bool OnDrawingContent (DrawContext? context)
|
||||
{
|
||||
foreach (LineCanvas canvas in Layers)
|
||||
{
|
||||
@@ -380,7 +380,7 @@ public class AttributeView : View
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override bool OnDrawingContent ()
|
||||
protected override bool OnDrawingContent (DrawContext? context)
|
||||
{
|
||||
Color fg = Value.Foreground;
|
||||
Color bg = Value.Background;
|
||||
|
||||
@@ -268,7 +268,7 @@ public class AttributeView : View
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override bool OnDrawingContent ()
|
||||
protected override bool OnDrawingContent (DrawContext? context)
|
||||
{
|
||||
Color fg = Value?.Foreground ?? Color.Black;
|
||||
Color bg = Value?.Background ?? Color.Black;
|
||||
|
||||
@@ -322,7 +322,7 @@ public class Snake : Scenario
|
||||
|
||||
private SnakeState State { get; }
|
||||
|
||||
protected override bool OnDrawingContent ()
|
||||
protected override bool OnDrawingContent (DrawContext? context)
|
||||
{
|
||||
SetAttribute (white);
|
||||
ClearViewport ();
|
||||
|
||||
@@ -109,7 +109,7 @@ internal class GradientsView : View
|
||||
private const int LABEL_HEIGHT = 1;
|
||||
private const int GRADIENT_WITH_LABEL_HEIGHT = GRADIENT_HEIGHT + LABEL_HEIGHT + 1; // +1 for spacing
|
||||
|
||||
protected override bool OnDrawingContent ()
|
||||
protected override bool OnDrawingContent (DrawContext? context)
|
||||
{
|
||||
DrawTopLineGradient (Viewport);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user