mirror of
https://github.com/Investigamer/cardconjurer.git
synced 2025-07-27 05:14:53 -05:00
visual art drag for landscape orientation
This commit is contained in:
@@ -1034,8 +1034,15 @@ function artDrag(e) {
|
|||||||
} else {
|
} else {
|
||||||
const endX = parseInt(e.clientX);
|
const endX = parseInt(e.clientX);
|
||||||
const endY = parseInt(e.clientY);
|
const endY = parseInt(e.clientY);
|
||||||
document.querySelector('#art-x').value = parseInt(document.querySelector('#art-x').value) + (endX - startX) * 2;
|
var changeX = (endX - startX) * 2;
|
||||||
document.querySelector('#art-y').value = parseInt(document.querySelector('#art-y').value) + (endY - startY) * 2;
|
var changeY = (endY - startY) * 2;
|
||||||
|
if (card.landscape) {
|
||||||
|
const temp = changeX;
|
||||||
|
changeX = -changeY;
|
||||||
|
changeY = temp;
|
||||||
|
}
|
||||||
|
document.querySelector('#art-x').value = parseInt(document.querySelector('#art-x').value) + changeX;
|
||||||
|
document.querySelector('#art-y').value = parseInt(document.querySelector('#art-y').value) + changeY;
|
||||||
startX = endX;
|
startX = endX;
|
||||||
startY = endY;
|
startY = endY;
|
||||||
artEdited();
|
artEdited();
|
||||||
|
Reference in New Issue
Block a user