Színkorrekciók
This commit is contained in:
1 parent
34a6df5949
commit
a1ff3beb35
471 files changed
+63615
-6
No files matched your search
+9
@@ -0,0 +1,9 @@
|
||||
const isDragging = {
|
||||
x: false,
|
||||
y: false,
|
||||
};
|
||||
function isDragActive() {
|
||||
return isDragging.x || isDragging.y;
|
||||
}
|
||||
|
||||
export { isDragActive, isDragging };
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
import { isDragging } from './is-active.mjs';
|
||||
|
||||
function setDragLock(axis) {
|
||||
if (axis === "x" || axis === "y") {
|
||||
if (isDragging[axis]) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
isDragging[axis] = true;
|
||||
return () => {
|
||||
isDragging[axis] = false;
|
||||
};
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (isDragging.x || isDragging.y) {
|
||||
return null;
|
||||
}
|
||||
else {
|
||||
isDragging.x = isDragging.y = true;
|
||||
return () => {
|
||||
isDragging.x = isDragging.y = false;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export { setDragLock };
|
||||
Reference in new issue
Block a user