Conversation
|
@tznind how about to do the same feature for double lines and for rounded corners, single and double lines? |
Should be pretty easy to add a setting for rounded corners on the class. It already supports double lines and mixing and matching single and double lines. |
Great. The |
|
💘 |
|
Why StraightLineCanvas? Why not just LineCanvas? I can't imagine (probably because I'm dum) anything but straight lines in a TUI. |
Hmn its not great is it... I was trying to articulate that it only supports I think you are right though and we can probably just go with And who knows maybe down the line we do add support for other line types e.g. with braille: |
|
I've marked this ready. There is room for improvement later on e.g. when making a T that goes from a double line down to a single line you can use ╨ but the number of combinations gets big fast and it would need quite a bit of work to implement them all. We can always go down that route later. |
You are right. I think for now you can force to all borders being single or double (vertical and horizontal). When you have time then you will have a lot of work 😃. |
Rename Drawing Scenario Make API simpler by directly referencing Application.Driver
Thanks for review and merge. I'll take a look into refactoring frame drawing, should cut down the code quite a bit but will have to be careful not to make mistakes and add good code coverage. Currently would be something like the below. But could add helper methods to LineCanvas to make it less verbose. var canvas = new LineCanvas();
canvas.AddLine(new Point(region.X + paddingLeft,fleft),fwidth,Orientation.Horizontal,borderStyle);
canvas.AddLine(new Point(ftop,fleft),fheight,Orientation.Vertical,borderStyle);
// TODO: Add lower left lines up and left
var bmp = canvas.GenerateImage(region);
for(int y=0;y< bmp.GetLength(0) ;y++)
for(int x=0;x< bmp.GetLength(1) ;x++)
{
var rune = bmp[y,x];
if(rune.HasValue)
{
AddRuneAt (region.X + x, region.Y + y, rune.Value);
}
} |


Fixes #_____ - Adds new class for drawing connected lines in arbitrary configurations
Pull Request checklist:
CTRL-K-Dto automatically reformat your files before committing.dotnet testbefore commit///style comments)