BREAKING CHANGES - Library Reform (see comment for details).#385
Merged
mitchmindtree merged 5 commits intoPistonDevelopers:masterfrom Apr 20, 2015
Merged
BREAKING CHANGES - Library Reform (see comment for details).#385mitchmindtree merged 5 commits intoPistonDevelopers:masterfrom
mitchmindtree merged 5 commits intoPistonDevelopers:masterfrom
Conversation
Merging with latest changes to master.
Merging with master.
Library Reform. Closes PistonDevelopers#372, PistonDevelopers#350, PistonDevelopers#354, PistonDevelopers#349 and PistonDevelopers#344. Changes related to PistonDevelopers#372.
Member
|
Nice! Now we can use |
Contributor
Author
|
@bvssvni has reviewed - there are a few things to address but they can easily be done in a future PR - going to merge 👍 |
mitchmindtree
added a commit
that referenced
this pull request
Apr 20, 2015
BREAKING CHANGES - Library Reform (see comment for details).
This was referenced May 7, 2015
Closed
Closed
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Sorry for the massive commit! The reform involved a lot of changes and it made sense to address some older issues while I was going. In general, I'm super excited about these changes :)
Here's a quick summary of changes before going into deets for a couple:
.setmethod for deferred drawing (see below)..down(20.0).align_middle(). (the default vertical alignment isLeftand the default horizontal alignment isTop.graphicsover toelmesque.dimensions.rs,rectangle.rs,shape.rs,draw.rs, andpoint.rsmodules.Widgetstruct to make theUiswidget_cachemuch cleaner.set_statefunction toui.set_widget(ui_id, Widget {...}).Removed Drawable trait in favour of
.setmethod.This change allows us to store renderable Elements in the Ui for deferred drawing, rather than drawing the widgets at their call site. This will allow ourselves and users to set custom rendering depths for widgets and will also make it extremely easy to make sure that captured widgets are rendered last (i.e. drawing an open DropDownList on top of widgets that are called after it).
Also, I've moved the UiId from the widget constructor to this set method so the user only has to deal with
Uirelated things in a single method. i.e. thisis now this
Now, draw is only called once: on the
Uitype after all the widgets have been set. When called, it will sort the widgets by rendering depth and then render all of the stored elements.Switched
graphicsover toelmesqueThis is the change that made deferring the rendering of widgets possible - rather than having to directly draw the widgets at the widgets' call site, we can use elmesque to compose an
Elementand store it within our WidgetCache. Note thatelmesquestill uses thegraphicscrate under the hood, but offers a high level interface for composition and layout. One issue with this is that it will require more allocations in order to be able to store the data within theElements and in turn this may impact performance. I have a few ideas for addressing this, but that will be for a future PR.What next?
These changes open up a few doorways! These are what I'm hoping to implement over the next couple days:
Uifor consideration when sorting for rendering order.Canvases (see Layout / Positioning API Draft #380), which will be one of the final steps towards offering a fully featured layout API without the need for coords :)Closes #372, #350, #354, #374, #373, #347, #349, #218, #344 and #145 🎉