nkh / P5-App-Asciio

Plain ASCII diagram
https://nkh.github.io/P5-App-Asciio/
56 stars 4 forks source link

Explain: create_line #38

Closed nkh closed 1 year ago

nkh commented 1 year ago

@qindapao, you've added the following bindings

'add ascii line'                      => ['CA0-i', \&App::Asciio::Actions::Elements::create_line, [0, 0]                                     ], 
'add unicode line 1'                  => ['C0S-i', \&App::Asciio::Actions::Elements::create_line, [1, 0]                                     ],
'add unicode line 2'                  => ['C00-i', \&App::Asciio::Actions::Elements::create_line, [2, 0]                                     ],
'add unicode line 3'                  => ['0A0-i', \&App::Asciio::Actions::Elements::create_line, [3, 0]                                     ],

They call this code:

https://github.com/nkh/P5-App-Asciio/blob/ee303f4fcf18c99470a055ab7ef8e68845edb410/lib/App/Asciio/Actions/Elements.pm#L147

none of those bindings work for me

qindapao commented 1 year ago

Just look at the final code, some of which have been modified since submission. I'll explain it to you after work tomorrow. It's late on my side now. The real function of this function is in another file, I wrote it imitating your other functions. Lines are just a few unicode arrows, removing the head and tail and automatic linking functions, mainly used to draw tables, especially cross mode. I'll elaborate on that later.

qindapao commented 1 year ago

I remember that these bindings changed in a later commit. So only the binding of the final code is correct.

nkh commented 1 year ago

You don't have to stress about the refactoring ticket, there are more coming, just handle them when you have time.

qindapao commented 1 year ago

@nkh

https://github.com/nkh/P5-App-Asciio/commit/efa6f79149366d0bb098c66505cd54dd3a46b233

I don't have much time recently, so I just wrote it down briefly.

nkh commented 1 year ago

I'll merge it and have a look at it.