mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-26 15:57:56 +01:00
* Added Applicaton.Popover. Refactored FindDeepestView * Popover prototype * Testing highlight * Fixed click outside issue * Fixed DialogTests * Fixed click outside issue (agbain) * Enabled mouse wheel in Bar * Enabled mouse wheel in Bar * Progress. Broke arrangement * Added popover tests. Fixed a bunch more CM issues related ot unreliable unit tests. Updated config.json to include Glyphs. * Can't set ForceDriver to empty in Resources/config.json. * added BUGBUG * Made Position/ScreenPosition clear * Added View.IsInHierarchy tests * Added Contextmenuv2 scenario. * Implemented CM2 in TextView * Removed unneeded CM stuff from testhelpers * Shortcut API docs * Fixed keybinding unit tests * Fixed mouse handling * Fighting with CM related unit test failures * Unit tests pass. I think. * Shortcut code cleanup * TextView uses new CM2 * Starting on OnSelect etc... * Starting on OnSelect etc... * Fixed ContextMenuv2 * ContextMenu is working again. * Ugh. ANd fixed button api docs * Fixed DrawHorizontalShadowTransparent (vertical was already fixed). * Made Scenarios compatible with #nullable enable * Undid some keybinding stuff * Fixed stuff * Sped up unit tests * Sped up unit tests 2 * Sped up unit tests 3 * Messing with menus * merged latest v2_develop * Added more Popover unit tests * Added more Popover unit tests2 * Fixed positioning bug * Fixed mouse bug * Fixed Bar draw issue * WIP * merge v2_develop * CM2 sorta works * Enabled Bar subclasses to have IDesignable * Added ViewportSettings.Transparent * Region -> nullable enable * Added ViewportSettigs Editor * merged v2_develop part 2 * merged v2_develop part 3 * WIP: GetViewsUnderMouse * WIP: More GetViewsUnderMouse work * Bars works again * Added unit tests * CM now works * MenuItemv2 POC * SubMenu POC * CommandNotBound * More POC * Optimize Margin to not defer draw if there's no shadow * Logger cleanup * Reverted Generic * Cascading mostly working * fixed layout bug * API docs * API docs * Fixed cascade * Events basically work * code cleanup * Fixed IsDefault bug; * Enabled hotkey support * Made context-menu-like * Improved usability * Refactored ApplicationPopover again * Cleanup * Menuv2 POC basically complete * Code Cleanup * Made menu API simpler * Fixed Strings bugs * Got old ContextMenu scenario mostly working * ContextMenu scenario now works * ContextMenu fixes * ContextMenu fixes * Tons of menu cleanup * ContextMenu works in TextView * Fixed unit tes * Added unit tests * Fixed tests * code cleanup * More code cleanup * Deep dive * scenario * typos * Demo colorpicker in a Menu * Added Region tests proving Region is broken in some Union cases * fixed v2win/net
This commit is contained in:
20
Tests/UnitTestsParallelizable/Drawing/DrawContextTests.cs
Normal file
20
Tests/UnitTestsParallelizable/Drawing/DrawContextTests.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
namespace Terminal.Gui.DrawingTests;
|
||||
|
||||
public class DrawContextTests
|
||||
{
|
||||
[Fact (Skip = "Region Union is broken")]
|
||||
public void AddDrawnRectangle_Unions ()
|
||||
{
|
||||
DrawContext drawContext = new DrawContext ();
|
||||
|
||||
drawContext.AddDrawnRectangle (new (0, 0, 1, 1));
|
||||
drawContext.AddDrawnRectangle (new (1, 0, 1, 1));
|
||||
|
||||
Assert.Equal (new Rectangle (0, 0, 2, 1), drawContext.GetDrawnRegion ().GetBounds ());
|
||||
Assert.Equal (2, drawContext.GetDrawnRegion ().GetRectangles ().Length);
|
||||
|
||||
drawContext.AddDrawnRectangle (new (0, 0, 4, 1));
|
||||
Assert.Equal (new Rectangle (0, 1, 4, 1), drawContext.GetDrawnRegion ().GetBounds ());
|
||||
Assert.Single (drawContext.GetDrawnRegion ().GetRectangles ());
|
||||
}
|
||||
}
|
||||
@@ -783,6 +783,46 @@ public class RegionTests
|
||||
Assert.True (region1.Contains (40, 40));
|
||||
}
|
||||
|
||||
[Fact (Skip = "Union is broken")]
|
||||
public void Union_Third_Rect_Covering_Two_Disjoint_Merges ()
|
||||
{
|
||||
var origRegion = new Region ();
|
||||
|
||||
var region1 = new Region (new (0, 0, 1, 1));
|
||||
var region2 = new Region (new (1, 0, 1, 1));
|
||||
|
||||
origRegion.Union(region1);
|
||||
origRegion.Union(region2);
|
||||
|
||||
Assert.Equal (new Rectangle (0, 0, 2, 1), origRegion.GetBounds ());
|
||||
Assert.Equal (2, origRegion.GetRectangles ().Length);
|
||||
|
||||
origRegion.Union(new Region(new (0, 0, 4, 1)));
|
||||
|
||||
Assert.Equal (new Rectangle (0, 1, 4, 1), origRegion.GetBounds ());
|
||||
Assert.Single (origRegion.GetRectangles ());
|
||||
}
|
||||
|
||||
[Fact (Skip = "MinimalUnion is broken")]
|
||||
public void MinimalUnion_Third_Rect_Covering_Two_Disjoint_Merges ()
|
||||
{
|
||||
var origRegion = new Region ();
|
||||
|
||||
var region1 = new Region (new (0, 0, 1, 1));
|
||||
var region2 = new Region (new (1, 0, 1, 1));
|
||||
|
||||
origRegion.Union (region1);
|
||||
origRegion.Union (region2);
|
||||
|
||||
Assert.Equal (new Rectangle (0, 0, 2, 1), origRegion.GetBounds ());
|
||||
Assert.Equal (2, origRegion.GetRectangles ().Length);
|
||||
|
||||
origRegion.MinimalUnion (new Region (new (0, 0, 4, 1)));
|
||||
|
||||
Assert.Equal (new Rectangle (0, 1, 4, 1), origRegion.GetBounds ());
|
||||
Assert.Single (origRegion.GetRectangles ());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Proves MergeRegion does not overly combine regions.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user