diff --git a/db.sqlite b/db.sqlite index 81c2c5d..84a1d69 100644 Binary files a/db.sqlite and b/db.sqlite differ diff --git a/pages/user/profile.vue b/pages/user/profile.vue index 660514c..4478ecc 100644 --- a/pages/user/profile.vue +++ b/pages/user/profile.vue @@ -33,26 +33,30 @@ const dragHandler = ({ delta: [x, y] }: { delta: number[] }) => { posY.value = clamp(posY.value + y, 0, 256 - size.value); }; -const axisModifier: Record void> = { - 'nw': ({values: [x, y]}: { values: number[]}): void => { - x = clamp(x - left.value, 0, 256) - posX.value; - y = clamp(y - top.value, 0, 256) - posY.value; - size.value = clamp(Math.min(x, y), 0, 256 - Math.max(posX.value, posY.value)); +const axisModifier: Record void> = { + 'nw': ({values: [x, y], delta: [_x, _y]}: { values: number[], delta: number[] }): void => { + x = clamp(x - left.value, 0, 256); + y = clamp(y - top.value, 0, 256); + + const scale = 256 - Math.min(x, y) / size.value; + + top = top + 256 - scale; + left = left + 256 - scale; }, 'ne': ({values: [x, y]}: { values: number[]}): void => { x = clamp(x - left.value, 0, 256) - posX.value; y = clamp(y - top.value, 0, 256) - posY.value; - size.value = clamp(Math.min(x, y), 0, 256 - Math.max(posX.value, posY.value)); + size.value = clamp(Math.min(x, y), 128, 256 - Math.max(posX.value, posY.value)); }, 'sw': ({values: [x, y]}: { values: number[]}): void => { x = clamp(x - left.value, 0, 256) - posX.value; y = clamp(y - top.value, 0, 256) - posY.value; - size.value = clamp(Math.min(x, y), 0, 256 - Math.max(posX.value, posY.value)); + size.value = clamp(Math.min(x, y), 128, 256 - Math.max(posX.value, posY.value)); }, 'se': ({values: [x, y]}: { values: number[]}): void => { x = clamp(x - left.value, 0, 256) - posX.value; y = clamp(y - top.value, 0, 256) - posY.value; - size.value = clamp(Math.min(x, y), 0, 256 - Math.max(posX.value, posY.value)); + size.value = clamp(Math.min(x, y), 128, 256 - Math.max(posX.value, posY.value)); }, }; @@ -71,7 +75,7 @@ const axisOptions: Partial = { -
+
@@ -93,8 +97,6 @@ const axisOptions: Partial = {
- > -