Code Monkey home page Code Monkey logo

Comments (3)

fireclawthefox avatar fireclawthefox commented on June 22, 2024

Hi,

sorry for taking so long to respond, seems I haven't been notified about your issue reports... Anyways, yeah, I am aware of this behavior, but I don't know where it comes from yet. It wasn't a high priority for me as I expected people would switch only once at the beginning of editing a GUI. I'm not even sure if it's fully possible to use both scales at the same time with the editor. But will take a look at it and see if I can enhance the editor performance in general.

from directguidesigner.

Epihaius avatar Epihaius commented on June 22, 2024

After some investigating, the culprit turns out to be the DirectGrid object.
In this line of code, when I change the grid spacing to a much smaller value like e.g. 0.005, the lag accordingly increases tenfold, more or less.
It seems that DirectGrid regenerates its geometry when setGridSpacing is called on it, creating as many grid lines as needed, depending on the given value, as well as on the current grid size.

So the solution seems quite simple: change the order of the calls to setGridSpacing and setGridSize; this made the lag disappear for me.
(Note that the order of these calls should not be changed in the code that switches from aspect2d to pixel2d.)

Hopefully that fixes this issue :) .

from directguidesigner.

fireclawthefox avatar fireclawthefox commented on June 22, 2024

Ah, yes, I also found that part. I've changed it a little differently though. In the new version I'm seting the grid size to 1 so it doesn't need to calculate as much at all in those calls and then set the size back to the desired value, which enhances the performance even a little more. Sadly i haven't had time to commit those changes yesterday, but I'll try to get the fix for this and your other issue up today.
Anyways, thanks for taking a look into this too.

from directguidesigner.

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.