Git Product home page Git Product logo

Comments (2)

Seneral avatar Seneral commented on May 30, 2024

Hey mitschoko, this is because GUILayoutUtility.GetRect not only calculates a rect for you, but also reserves the space in the layout system. Usually, getRect is used to pass into normal GUI functions so that is ok, and that's also the reason why everything else in Node Editor is normal. Node Bodies however, use GUILayout.BeginArea, so you can use GUILayout funtions in the nodes. Somehow this interfers with the reserved space... I need to work out a solution for that, preferely so that I do not need to use GUILayout.BeginArea for node bodies :)

from node_editor_framework.

Seneral avatar Seneral commented on May 30, 2024

Ok the above was just an assumption which prooved to be wrong after a test, fortunately. It was simply a bug when passing (0, 0, 1, 1), which GetRect returns when layouting. So changing the rect code to the following works:

Rect canvasRect = GUILayoutUtility.GetRect (600, 600);
if (Event.current.type != EventType.Layout)
    editorState.canvasRect = canvasRect;

Important is here the check for Layout event and that GetRect is still called when layouting to not throw errors:)
Hope that fixes it for you;)

from node_editor_framework.

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.