Update coords box to behave based on grid mode.
This commit is contained in:
parent
5cc47c4a81
commit
9ddbacb4de
1 changed files with 13 additions and 1 deletions
|
|
@ -511,7 +511,6 @@ gridEl.addEventListener('pointermove', (e) => {
|
||||||
|
|
||||||
const { ix, iy, x: snapX, y: snapY } = snapToGrid(e.clientX, e.clientY);
|
const { ix, iy, x: snapX, y: snapY } = snapToGrid(e.clientX, e.clientY);
|
||||||
|
|
||||||
coordsEl.innerText = `(${ix}, ${iy})`;
|
|
||||||
|
|
||||||
const renderX = snapX - {{ dot_size }} / 2;
|
const renderX = snapX - {{ dot_size }} / 2;
|
||||||
const renderY = snapY - {{ dot_size }} / 2;
|
const renderY = snapY - {{ dot_size }} / 2;
|
||||||
|
|
@ -522,6 +521,19 @@ gridEl.addEventListener('pointermove', (e) => {
|
||||||
dotEl.style.top = `${renderY}px`;
|
dotEl.style.top = `${renderY}px`;
|
||||||
dotEl.style.left = `${renderX}px`;
|
dotEl.style.left = `${renderX}px`;
|
||||||
|
|
||||||
|
const type = getActiveType();
|
||||||
|
|
||||||
|
var coordsX = `${renderX}px`;
|
||||||
|
var coordsY = `${renderY}px`;
|
||||||
|
if (type === 'fullGrid' || type === 'verticalGrid') {
|
||||||
|
coordsX = `${ix}g`;
|
||||||
|
}
|
||||||
|
if (type === 'fullGrid' || type === 'horizontalGrid') {
|
||||||
|
coordsY = `${iy}g`;
|
||||||
|
}
|
||||||
|
|
||||||
|
coordsEl.innerText = `(${coordsX}, ${coordsY})`;
|
||||||
|
|
||||||
if (currentShape) {
|
if (currentShape) {
|
||||||
const tool = currentShape.tool;
|
const tool = currentShape.tool;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue