Giter Club home page Giter Club logo

Comments (4)

Dgame avatar Dgame commented on May 24, 2024

That would destroy the const'ness of width and height. But I could offer the possibility to call a redraw/update method manually.

from dgame.

Dgame avatar Dgame commented on May 24, 2024

Hope that is enough for your purpose.

from dgame.

opatut avatar opatut commented on May 24, 2024

While I pretty much dislike such unintuitive API, I guess there is no way around it... can't remove const'ness from width/height getters, of course.

What I've seen in other libs is things like Font::getDimensions or Text::calculateBounds or similar, which would not need to be const. However, that would mean 2 APIs (width/height + calculateBounds) for the same thing, which is of course another no-go.

I can't think of something that works well and gets the job done, sadly (except re-drawing every change, which is ridiculous 😉 ). So I guess going for .update would be best (I don't like "redraw" since it sounds like it should be called after draw, not before).

Edit: damn, I've gotten slow :) Thanks for the quick fix!

from dgame.

Dgame avatar Dgame commented on May 24, 2024

Yes, sadly it is not the nicest choice, but the only one without massive intervention.

Edit: damn, I've gotten slow :) Thanks for the quick fix!
You're welcome. :)

from dgame.

Related Issues (20)

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.