From 0e13a8c00ffa2bccca2fbb81f387ce6abd11a09a Mon Sep 17 00:00:00 2001 From: Kapil Reddy Date: Sun, 27 Oct 2024 00:25:52 +0530 Subject: [PATCH] FIX Stop drawing grid on each grid click --- r_place_ui/src/place/core.cljs | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/r_place_ui/src/place/core.cljs b/r_place_ui/src/place/core.cljs index 989d6a6..41777da 100644 --- a/r_place_ui/src/place/core.cljs +++ b/r_place_ui/src/place/core.cljs @@ -68,9 +68,8 @@ (:current-color @app-state))] (draw-pixel x y color) (send-pixel! (Math/floor (/ x grid-size)) - (Math/floor (/ y grid-size)) - color) - (draw-grid))) + Math/floor + color))) (events/listen canvas "click" handle-canvas-click) @@ -99,12 +98,7 @@ - (def socket* (setup-ws "ws://localhost:8080/ws" - (fn [] - (js/console.log "Socket connected")) - (fn [e] - (js/console.log e.data) - (websocket-message-handler e.data))))) + ) (comment @@ -125,6 +119,13 @@ on-message-fn) socket)) +(do (def socket* (setup-ws "ws://localhost:8080/ws" + (fn [] + (js/console.log "Socket connected")) + (fn [e] + (js/console.log e.data) + (websocket-message-handler e.data))))) + (def sample-data {:column 0 :row 1