jeffeb3 / sandify

web based user interface to create patterns that could be useful for robots that draw in sand with ball bearings.
MIT License
187 stars 34 forks source link

Feature/selector optimization 2 #209

Closed bobnik closed 3 years ago

bobnik commented 3 years ago

This is a refactor of my earlier optimization PR. The primary goal is to optimize selector invalidation. Please test this extensively (specifically, a variety of layer manipulations, both within the layer and between (moving layers, show/hide layer, etc.)

A few other features:

jeffeb3 commented 3 years ago

This seems to work great. I don't really understand it. I really need a refresher on redux, I guess.

jeffeb3 commented 3 years ago

screenshot-2021-09-01-1630517263

I was playing with a mask, on a star, with another layer there too. I was grabbing the resize corner of the mask (I think) and I got this error. I could easily check to see if props.layer.id is valid, but I don't understand it enough to know if this function should have even been called. I haven't been able to reproduce it. Do you have any thoughts on it?

bobnik commented 3 years ago

I was playing with a mask, on a star, with another layer there too. I was grabbing the resize corner of the mask (I think) and I got this error. I could easily check to see if props.layer.id is valid, but I don't understand it enough to know if this function should have even been called. I haven't been able to reproduce it. Do you have any thoughts on it?

I can't seem to reproduce this. I'm hesitant to introduce an issue that crashes the app into production, but I'm not sure how to fix if I can't reproduce. It's up to you. The optimizations will certainly help general use.