jtdaugherty / vty

A high-level ncurses alternative written in Haskell
BSD 3-Clause "New" or "Revised" License
319 stars 57 forks source link

Image: unified cropping constructor #250

Closed frasertweedale closed 1 year ago

frasertweedale commented 1 year ago

Instead of 4 different cropping constructors, unify them into a single constructor. This simplifies the code and also "flattens" the image structure when different sides of the image have been cropped.

Note: this is not intended as a performance optimisation and I have not measured the performance impact. Rather, I was wanting to learn more about vty internals and noticed this cleanup opportunity. I humbly submit the current patch for your consideration but no hard feelings if you prefer to leave things as they are.

jtdaugherty commented 1 year ago

Thanks!