radames commited on
Commit
bf002ae
1 Parent(s): a439de3
frontend/src/lib/App.svelte CHANGED
@@ -39,7 +39,6 @@
39
 
40
  let showModal = false;
41
 
42
- $: isPrompting = $myPresence?.status === Status.prompting || false;
43
  $: isLoading = $myPresence?.status === Status.loading || false;
44
 
45
  $: {
 
39
 
40
  let showModal = false;
41
 
 
42
  $: isLoading = $myPresence?.status === Status.loading || false;
43
 
44
  $: {
frontend/src/lib/PaintCanvas.svelte CHANGED
@@ -4,7 +4,6 @@
4
  import { onMount } from 'svelte';
5
  import { PUBLIC_UPLOADS } from '$env/static/public';
6
  import { currZoomTransform, canvasEl } from '$lib/store';
7
- import { round } from '$lib/utils';
8
 
9
  import { useMyPresence, useObject } from '$lib/liveblocks';
10
  import type { PromptImgObject } from '$lib/types';
 
4
  import { onMount } from 'svelte';
5
  import { PUBLIC_UPLOADS } from '$env/static/public';
6
  import { currZoomTransform, canvasEl } from '$lib/store';
 
7
 
8
  import { useMyPresence, useObject } from '$lib/liveblocks';
9
  import type { PromptImgObject } from '$lib/types';
frontend/src/lib/PaintFrame.svelte CHANGED
@@ -6,23 +6,21 @@
6
  import LoadingIcon from '$lib/Icons/LoadingIcon.svelte';
7
 
8
  import { drag } from 'd3-drag';
9
- import { select, type Selection } from 'd3-selection';
10
  import { round } from '$lib/utils';
11
 
12
  import type { ZoomTransform } from 'd3-zoom';
13
  import { onMount, createEventDispatcher } from 'svelte';
14
 
15
  import { useMyPresence } from '$lib/liveblocks';
16
- import { loadingState, canvasEl, maskEl } from '$lib/store';
17
 
18
- import { toggle_class } from 'svelte/internal';
19
  import { Status } from './types';
20
  const myPresence = useMyPresence();
21
 
22
  const dispatch = createEventDispatcher();
23
 
24
  export let transform: ZoomTransform;
25
- export let color = 'black';
26
 
27
  let maskCtx: CanvasRenderingContext2D;
28
 
@@ -35,8 +33,9 @@
35
  let dragEnabled = true;
36
  let isDragging = false;
37
  $: prompt = $myPresence?.currentPrompt;
38
- $: isLoading = $myPresence?.status === Status.loading || $myPresence?.status === Status.prompting || false;
39
-
 
40
  $: coord = {
41
  x: transform.applyX(position.x),
42
  y: transform.applyY(position.y)
@@ -75,7 +74,7 @@
75
  .call(cursorUpdate);
76
  });
77
 
78
- function cursorUpdate(selection) {
79
  function handlePointerMove(event: PointerEvent) {
80
  myPresence.update({
81
  cursor: {
@@ -111,8 +110,9 @@
111
  lasty = y;
112
  }
113
 
114
- function dragended(event: Event) {}
115
- return drag().on('start', dragstarted).on('drag', dragged).on('end', dragended);
 
116
  }
117
  function dragMoveHandler() {
118
  function dragstarted(event: Event) {
 
6
  import LoadingIcon from '$lib/Icons/LoadingIcon.svelte';
7
 
8
  import { drag } from 'd3-drag';
9
+ import { select } from 'd3-selection';
10
  import { round } from '$lib/utils';
11
 
12
  import type { ZoomTransform } from 'd3-zoom';
13
  import { onMount, createEventDispatcher } from 'svelte';
14
 
15
  import { useMyPresence } from '$lib/liveblocks';
16
+ import { canvasEl, maskEl } from '$lib/store';
17
 
 
18
  import { Status } from './types';
19
  const myPresence = useMyPresence();
20
 
21
  const dispatch = createEventDispatcher();
22
 
23
  export let transform: ZoomTransform;
 
24
 
25
  let maskCtx: CanvasRenderingContext2D;
26
 
 
33
  let dragEnabled = true;
34
  let isDragging = false;
35
  $: prompt = $myPresence?.currentPrompt;
36
+ $: isLoading =
37
+ $myPresence?.status === Status.loading || $myPresence?.status === Status.prompting || false;
38
+
39
  $: coord = {
40
  x: transform.applyX(position.x),
41
  y: transform.applyY(position.y)
 
74
  .call(cursorUpdate);
75
  });
76
 
77
+ function cursorUpdate(selection: any) {
78
  function handlePointerMove(event: PointerEvent) {
79
  myPresence.update({
80
  cursor: {
 
110
  lasty = y;
111
  }
112
 
113
+ // function dragended(event: Event) {}
114
+ return drag().on('start', dragstarted).on('drag', dragged);
115
+ // on('end', dragended);
116
  }
117
  function dragMoveHandler() {
118
  function dragstarted(event: Event) {