mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
Make new architecture the default and validate all tests pass
Co-authored-by: tig <585482+tig@users.noreply.github.com>
This commit is contained in:
@@ -34,7 +34,7 @@ public class TextFormatter
|
||||
/// When true, the Draw method will use the new separated formatter/renderer architecture.
|
||||
/// This provides better performance and addresses Format/Draw coupling issues.
|
||||
/// </summary>
|
||||
public bool UseNewArchitecture { get; set; } = false;
|
||||
public bool UseNewArchitecture { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="TextFormatter"/> class.
|
||||
|
||||
@@ -150,17 +150,17 @@ public class TextFormatterNewArchitectureTests
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void TextFormatter_UseNewArchitecture_Flag_Works()
|
||||
public void TextFormatter_UseNewArchitecture_Flag_DefaultsToTrue()
|
||||
{
|
||||
Application.Init(new FakeDriver());
|
||||
|
||||
var tf = new TextFormatter
|
||||
{
|
||||
Text = "Hello World",
|
||||
UseNewArchitecture = true // Enable new architecture
|
||||
Text = "Hello World"
|
||||
// UseNewArchitecture defaults to true now
|
||||
};
|
||||
|
||||
// This should now use the new architecture via the Draw method
|
||||
// This should use the new architecture by default
|
||||
tf.Draw(new Rectangle(0, 0, 10, 1), Attribute.Default, Attribute.Default);
|
||||
|
||||
// Test that the new architecture produces results
|
||||
@@ -168,6 +168,9 @@ public class TextFormatterNewArchitectureTests
|
||||
Assert.True(size.Width > 0);
|
||||
Assert.True(size.Height > 0);
|
||||
|
||||
// Verify default is true
|
||||
Assert.True(tf.UseNewArchitecture);
|
||||
|
||||
Application.Shutdown();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user