| | |
| | | const width = contentRef.current.offsetWidth; |
| | | const height = contentRef.current.offsetHeight; |
| | | app.renderer.resize(width, height); |
| | | if (model !== MapModel.OBSERVER_MODEL) { |
| | | player.hideGridlines(); |
| | | player.showGridlines(); |
| | | } |
| | | }, [app, mapContainer, windowSize]) |
| | | |
| | | // model |
| | |
| | | }, [model]); |
| | | |
| | | // Add New Device |
| | | const onDrop = (sprite, x, y) => { |
| | | const onDrop = (sprite, type, x, y) => { |
| | | const { mapX, mapY } = Utils.getRealPosition(x, y, mapContainer); |
| | | sprite.x = mapX; |
| | | sprite.y = mapY; |
| | | |
| | | Utils.initSprite(sprite); |
| | | Utils.initSprite(sprite, type); |
| | | mapContainer.addChild(sprite); |
| | | Utils.beMovable(sprite, setDidClickSprite); |
| | | }; |
| | |
| | | setSettingsVisible(false); |
| | | setSpriteBySettings(null); |
| | | }} |
| | | setSpriteBySettings={setSpriteBySettings} |
| | | setDidClickSprite={setDidClickSprite} |
| | | refCurr={mapRef.current} |
| | | onSubmit={settingsFinish} |
| | | /> |