Coder Social home page Coder Social logo

Comments (4)

craigmjohnston avatar craigmjohnston commented on May 26, 2024

It looks like none of the Paragraph objects are being added because it thinks they're all out of bounds here (SelectList.cs line 285):

// if out of list bounderies remove this paragraph and stop
if ((paragraph.GetActualDestRect().Bottom > _destRect.Bottom - _scaledPadding.Y) || i > _list.Count) {
  RemoveChild(paragraph);
  _paragraphs.Remove(paragraph);
  break;
}

Removing that check (just to test if everything else works) adds all the paragraphs in the correct positions, etc. but obviously overflows the container if you have too many items. So it seems as if everything works fine, except for that check.

from geonbit.ui.

RonenNess avatar RonenNess commented on May 26, 2024

Hi I think you might have a bug elsewhere. The code

               Panel panel = new Panel(new Vector2(300, 400));
                SelectList selectList = new SelectList();
                panel.AddChild(selectList);
                selectList.AddItem("Example item");
                UserInterface.AddEntity(panel); // <-- added this line, I assume you omitted it

Works. Also if you look at the GeonBit.UI demo there's a button to show "Events list" which opens up a list that record all callbacks, and its dynamic.

Can you post more code?
Thanks

from geonbit.ui.

craigmjohnston avatar craigmjohnston commented on May 26, 2024

Argh, yeah you're right. I'll have to go back through and check, it seems as if this works just fine in a blank project.

EDIT: yep, the changes I made in #10 were the cause, whoops.

Sorry about that!

from geonbit.ui.

RonenNess avatar RonenNess commented on May 26, 2024

Its cool.
I see you already have a good lead with the code you posted that calculate when the item overflows the listbox, you just need to figure out why its different in your fork. Probably dest rect not calculated on time or something like that (just a wild guess).

If you have any questions don't hesitate to ask! :)

from geonbit.ui.

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.