Comments (2)
Indeed looks so. Will have to have a look into this.
from stardewplanner.
I don't know if you've had a chance to look at this yet, but I spent some time digging into it and it looks like slowdown is caused by the event handlers for old boards not being unregistered on layout change. Particularly the board.R.drag
handler - as soon as I called undrag()
on layout change the brush dragging became much snappier. You can inspect board.R.events
in the console and see that there's a set listed per layout loaded.
Instead of cleaning up and then initializing a new board, we can just swap in the board parts that need to be changed. I tested this locally, and it looks like your board.loadLayout
method handles everything you need on layout change. All of the handler, helper, defs, etc setup in the board constructor is still good to go and doesn't need to be re-executed if we're using the same board.
I made a PR with that change so you can test it out yourself. If there's a reason to initialize a new board though, you can also fix the performance drop by unregistering the events from the old board on layout switch.
from stardewplanner.
Related Issues (20)
- Blocked from placing road tiles on non-tillable land
- Drag filling crops placnig crops under sprinklers etc
- Scarecrow highlight invisible on farmable tiles to red-green colorblind people
- Consider adding a layout for the farmhouse interiors
- Can't render while using some layouts HOT 2
- Greenhouse should be movable HOT 5
- Missing 1.5 content HOT 3
- Problems with iOS
- [BUG] Save Plan as Picture feature fails HOT 1
- [TYPO] Sprite Data for mini-shipping-bin misspelled "mini-shopping-bin"
- [BUG] npm install fails using node v14.15.3 HOT 1
- Floor tiles can't be placed on edges of the planner HOT 1
- Trees grown using tree fertilizer are not rendered HOT 3
- Add optional tooltips when hovering over items
- Feature request: 2x or 3x zoom HOT 1
- Slime Hutch Layout missing
- Ads Cover Half the Planner HOT 4
- Would you be able to update Nexus with the latest version?
- Suggestion: Moving the greenhouse HOT 2
- v3: Missing detail
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stardewplanner.