Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
} from 'react-native';
import { runOnJS, useAnimatedReaction, useSharedValue } from 'react-native-reanimated';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
import { DrawingCanvas, type DrawingCanvasRef } from '@repo/pointer-native-drawing';

import { ContentInset, Header, PointerContentView } from '@components/common';
import { postAnswer, useGetScrapStatusById, useToggleScrapFromProblem } from '@apis/student';
Expand All @@ -38,7 +39,6 @@ import ResultSheet from '../components/ResultSheet';
import AnswerKeyboardSheet from '../components/AnswerKeyboardSheet';
import BottomActionBar from '../components/BottomActionBar';
import { buildDocumentInit } from '../transforms/contentRendererTransforms';
import { DrawingCanvas, type DrawingCanvasRef } from '../../scrap/utils/skia';
import { useDrawingState } from '../../scrap/hooks/useDrawingState';
import { ProblemDrawingToolbar } from '../components/ProblemDrawingToolbar';
import { ConfirmationModal } from '../../scrap/components/Dialog';
Expand Down Expand Up @@ -536,7 +536,7 @@ const ProblemScreen = ({ navigation }: ProblemScreenProps) => {
ref={canvasRef}
strokeColor='#1E1E21'
strokeWidth={2}
eraserMode={drawingState.isEraserMode}
activeTool={drawingState.isEraserMode ? 'eraser' : 'pen'}
eraserSize={12}
onHistoryChange={drawingState.setHistoryState}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useEffect, useCallback, useRef } from 'react';
import { Alert, AppState, type AppStateStatus } from 'react-native';
import { type DrawingCanvasRef } from '@repo/pointer-native-drawing';

import { useGetHandwriting, useUpdateHandwriting } from '@/apis';

import { type DrawingCanvasRef } from '../utils/skia/drawing';
import { encodeHandwritingData, decodeHandwritingData } from '../utils/handwritingEncoder';

export interface UseHandwritingManagerProps {
Expand Down Expand Up @@ -50,7 +50,7 @@ export function useHandwritingManager({
try {
const decodedData = decodeHandwritingData(handwritingData.data);
canvasRef.current.setStrokes(decodedData.strokes);
canvasRef.current.setTexts(decodedData.texts);
// textbox 임시 비활성화 — setTexts 호출 제거 (재활성화 시 부활)
lastSavedDataRef.current = handwritingData.data;
} catch (error) {
console.error('필기 데이터 로드 실패:', error);
Expand All @@ -73,10 +73,10 @@ export function useHandwritingManager({
}

const strokes = canvasRef.current.getStrokes();
const texts = canvasRef.current.getTexts();
// textbox 임시 비활성화 — getTexts 호출 제거. 빈 배열로 encode.

try {
const base64Data = encodeHandwritingData(strokes || [], texts || []);
const base64Data = encodeHandwritingData(strokes || [], []);

// 변경사항 없으면 저장 안 함
if (base64Data === lastSavedDataRef.current) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import Animated, {
} from 'react-native-reanimated';
import { Gesture, GestureDetector } from 'react-native-gesture-handler';
import { useQueryClient } from '@tanstack/react-query';
import { DrawingCanvas, type DrawingCanvasRef } from '@repo/pointer-native-drawing';

import { colors } from '@/theme/tokens';
import { useNoteStore } from '@/features/student/scrap/stores/scrapNoteStore';
Expand All @@ -37,7 +38,6 @@ import {
import { type StudentRootStackParamList } from '@/navigation/student/types';

import { toAlphabetSequence } from '../utils/formatters/toAlphabetSequence';
import DrawingCanvas, { type DrawingCanvasRef } from '../utils/skia/drawing';
import { ScrapDetailHeader } from '../components/Header/ScrapDetailHeader';
import { TabNavigator } from '../components/scrap/TabNavigator';
import { FilterBar } from '../components/scrap/FilterBar';
Expand Down Expand Up @@ -639,8 +639,7 @@ const ScrapDetailScreen = () => {
ref={canvasRef}
strokeColor='#1E1E21'
strokeWidth={drawingState.strokeWidth}
textMode={drawingState.isTextMode}
eraserMode={drawingState.isEraserMode}
activeTool={drawingState.isEraserMode ? 'eraser' : 'pen'}
eraserSize={drawingState.eraserSize}
onHistoryChange={drawingState.setHistoryState}
/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
import { type Stroke, type TextItem } from './skia/drawing';
import { type Stroke } from '@repo/pointer-native-drawing';

// 텍스트박스 임시 비활성화 — local TextItem 정의 유지 (서버 schema 호환).
// 재활성화 시 @repo/pointer-native-drawing 으로 환원.
type TextItem = {
id: string;
text: string;
x: number;
y: number;
fontSize: number;
color: string;
};

export interface HandwritingData {
strokes: Stroke[];
Expand Down
Loading
Loading