diff options
Diffstat (limited to 'frontend/views/page/components/page.editor.js')
| -rw-r--r-- | frontend/views/page/components/page.editor.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/frontend/views/page/components/page.editor.js b/frontend/views/page/components/page.editor.js index dbf0be9..a806dc0 100644 --- a/frontend/views/page/components/page.editor.js +++ b/frontend/views/page/components/page.editor.js @@ -9,7 +9,7 @@ import * as pageActions from '../page.actions' import * as tileActions from '../../tile/tile.actions' import { Loader } from '../../../common' -import { clamp } from '../../../util' +import { clamp, dist } from '../../../util' const defaultState = { dragging: false, @@ -134,7 +134,7 @@ class PageEditor extends Component { draggingBox: false, }) // console.log(page) - if (dx + dy < 2) { + if (dist(0, 0, dx, dy) < 2) { return } const updatedTile = { @@ -184,7 +184,7 @@ class PageEditor extends Component { key={temporaryTile.id} tile={temporaryTile} bounds={this.state.bounds} - box={currentTile && tile.id === currentTile.id && currentBox} + box={currentTile && temporaryTile.id === currentTile.id && currentBox} onMouseDown={e => this.handleMouseDown(e, temporaryTile)} /> )} @@ -235,7 +235,7 @@ const TileHandle = ({ tile, bounds, box, onMouseDown }) => { } const generateTransform = (tile, box) => { - const { x, y, align, rotation, scale, is_tiled } = tile.settings + let { x, y, align, rotation, scale, is_tiled } = tile.settings if (is_tiled) { return 'translateZ(0)' } |
