Toggle navigation
Toggle navigation
This project
Loading...
Sign in
강동현
/
nodejs-game
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Overnap
2021-06-08 06:48:29 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7c8424c6f9b2f4c5a1439ea6ecaac544849220d5
7c8424c6
1 parent
0a3f911f
Builds for 1 pipeline
failed
in 1 minute 22 seconds
clearCanvas 콜백 추가
Changes
1
Builds
3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
web/src/components/room/Canvas.tsx
web/src/components/room/Canvas.tsx
View file @
7c8424c
...
...
@@ -38,6 +38,15 @@ export const Canvas: React.FC = () => {
}
}, []);
const clearCanvas = useCallback(() => {
if (canvasRef.current) {
const context = canvasRef.current.getContext('2d');
if (context) {
context.clearRect(0, 0, canvasRef.current.width, canvasRef.current.height);
}
}
}, []);
const startPaint = useCallback((event: MouseEvent) => {
const coordinates = getCoordinates(event);
if (coordinates) {
...
...
Please
register
or
login
to post a comment