-
Notifications
You must be signed in to change notification settings - Fork 743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Morphic: deprecate non-silent set* Functions? #2173
Comments
Isn't the standard thing to have each object have a dirty bit that's set by the Set functions, and then, when it's time to refresh the display, redraw all the dirty objects at once? |
In some systems, yeah. But in Morphic the drawNew functions don’t ever seem to deal with dirty checking.
There are a set of dirty tools based on checking intersections of other morphs (which you can call with changed() and fullChanged()). But I don’t understand when you’re supposed to use one over the other.
I started messing with some of this because I got really frustrated importing tools and wanted to speed things up.
Basically, in the case of blocks, we layout the positions of blocks in script (in custom blocks) when importing blocks. It seems like we shouldn’t need to ever try to layout a custom block until a script pane is opened.
…--
Michael Ball
From my iPhone
michaelball.co
On Aug 7, 2018, at 8:22 AM, Brian Harvey ***@***.***> wrote:
Isn't the standard thing to have each object have a dirty bit that's set by the Set functions, and then, when it's time to refresh the display, redraw all the dirty objects at once?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Yes, I'm all for that! The goal is to make loading libraries so blindingly fast that Jens will finally agree to automatic loading of the tools library when a new project is created. |
Obsoleted with morphic2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
OK, maybe I'm misunderstanding things, but it seems like there's a lot of easy optimizations to do because morphic makes it easy to redraw way too often.
My understanding:
We have setPosition, Width, Height, Extent and so one. These all have silent variants which update the properties by do not do any new drawing of an object.
In Snap! it's super common to use multiple
set*
functions over a bunch of different calls, but this leads to a bunch of intermediate draws which are basically not seen to the user.It seems like the ideal situation is to just do everything silently and then have the caller use one
drawNew
call at the end of all the updates. Far more often that not, it seems like when doing layout there's get a lot of the setX functions, and very seldom do you only use one and want to redraw.I don't know, did I just propose something super heretical to the Squeak-ers?
The other option is to some how have set* functions be aware of their caller and then delay drawing until the very end, but this seems complex and maybe error prone.
The text was updated successfully, but these errors were encountered: