Optimize View drawing logic and update ClearViewport tests

Refactored the `View` class to include a `NeedsDraw` check in
multiple drawing methods, improving rendering efficiency.
Adjusted `OnDrewText` and `DrewText` event handling for
consistency. Removed unused code and redundant tests.

Rewrote and reorganized `ClearViewportTests` for clarity and
compatibility with the new `NeedsDraw` logic. Added new tests
to validate `ClearViewport` behavior under various conditions,
including transparent viewports, event cancellations, and
content-only clearing.

Updated namespaces for better alignment, disabled a noisy
`ComboBoxTests` test, and improved code formatting and
maintainability across files.
This commit is contained in:
Tig
2025-12-03 16:30:22 -07:00
parent 6049857813
commit 641a0a599c
5 changed files with 60 additions and 74 deletions

View File

@@ -205,34 +205,6 @@ public class ViewDrawTextAndLineCanvasTests () : FakeDriverBase
Assert.True (eventRaised);
}
[Fact]
public void DrewText_Event_Raised ()
{
IDriver driver = CreateFakeDriver (80, 25);
driver.Clip = new Region (driver.Screen);
bool eventRaised = false;
var view = new View
{
X = 10,
Y = 10,
Width = 20,
Height = 20,
Driver = driver,
Text = "Test"
};
view.BeginInit ();
view.EndInit ();
view.LayoutSubViews ();
view.DrewText += (s, e) => eventRaised = true;
view.Draw ();
Assert.True (eventRaised);
}
#endregion
#region LineCanvas Tests