Giter Site home page Giter Site logo

Comments (3)

ghaiklor avatar ghaiklor commented on May 20, 2024

@ChristianKienle wow, sorry for such a long reply :)
I just got time to get through all the notifications.

Regard your question, no. There is no such a way to change canvas size without creating a new one.

from terminal-canvas.

ChristianKienle avatar ChristianKienle commented on May 20, 2024

Regard your question, no. There is no such a way to change canvas size without creating a new one.

Thanks for the response :)

It is a while back when I last worked on the project using terminal-canvas. I believe I ended up by disabling (showing the current size w/h instead) UI updates while the resizing occurs. This was good enough for a CLI UI. I wonder how ncurses is doing it though. :D

from terminal-canvas.

ghaiklor avatar ghaiklor commented on May 20, 2024

If you ask me, I'd try to implement it via vectors in terminal-canvas, not just arrays.

The problem here, why it can't be easily done here is that, I'm pre-allocating required space for frame buffer by calling Array.new(witdth * height). It is done for performance optimizations.

So, if you want to change width or height, you will be forced to allocate new array and re-assign it to variable, which is obviously will be slow. Especially, if you do it in each resize event.

from terminal-canvas.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.