Skip to content

Commit e69fe64

Browse files
committed
Enable text editing mode on text annotation creation
1 parent 7b5cc5c commit e69fe64

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

apps/desktop/src/routes/screenshot-editor/AnnotationLayer.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,14 @@ export function AnnotationLayer(props: {
446446
setIsDrawing(false);
447447
setActiveTool("select");
448448
setSelectedAnnotationId(ann.id);
449+
450+
if (ann.type === "text") {
451+
textSnapshot = {
452+
project: structuredClone(unwrap(project)),
453+
annotations: structuredClone(unwrap(annotations)),
454+
};
455+
setTextEditingId(ann.id);
456+
}
449457
}
450458

451459
if (dragState()) {

apps/desktop/src/utils/tauri.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,6 @@ uploadProgressEvent: "upload-progress-event"
369369

370370
/** user-defined types **/
371371

372-
export type AllGpusInfo = { gpus: GpuInfoDiag[]; primaryGpuIndex: number | null; isMultiGpuSystem: boolean; hasDiscreteGpu: boolean }
373372
export type Annotation = { id: string; type: AnnotationType; x: number; y: number; width: number; height: number; strokeColor: string; strokeWidth: number; fillColor: string; opacity: number; rotation: number; text: string | null; maskType?: MaskType | null; maskLevel?: number | null }
374373
export type AnnotationType = "arrow" | "circle" | "rectangle" | "text" | "mask"
375374
export type AppTheme = "system" | "light" | "dark"
@@ -438,7 +437,6 @@ quality: number | null;
438437
* Whether to prioritize speed over quality (default: false)
439438
*/
440439
fast: boolean | null }
441-
export type GpuInfoDiag = { vendor: string; description: string; dedicatedVideoMemoryMb: number; adapterIndex: number; isSoftwareAdapter: boolean; isBasicRenderDriver: boolean; supportsHardwareEncoding: boolean }
442440
export type HapticPattern = "alignment" | "levelChange" | "generic"
443441
export type HapticPerformanceTime = "default" | "now" | "drawCompleted"
444442
export type Hotkey = { code: string; meta: boolean; ctrl: boolean; alt: boolean; shift: boolean }
@@ -451,6 +449,7 @@ export type JsonValue<T> = [T]
451449
export type LogicalBounds = { position: LogicalPosition; size: LogicalSize }
452450
export type LogicalPosition = { x: number; y: number }
453451
export type LogicalSize = { width: number; height: number }
452+
export type MacOSVersionInfo = { displayName: string }
454453
export type MainWindowRecordingStartBehaviour = "close" | "minimise"
455454
export type MaskKeyframes = { position?: MaskVectorKeyframe[]; size?: MaskVectorKeyframe[]; intensity?: MaskScalarKeyframe[] }
456455
export type MaskKind = "sensitive" | "highlight"
@@ -493,7 +492,6 @@ export type RecordingStatus = "pending" | "recording"
493492
export type RecordingStopped = null
494493
export type RecordingTargetMode = "display" | "window" | "area"
495494
export type RenderFrameEvent = { frame_number: number; fps: number; resolution_base: XY<number> }
496-
export type RenderingStatus = { isUsingSoftwareRendering: boolean; isUsingBasicRenderDriver: boolean; hardwareEncodingAvailable: boolean; warningMessage: string | null }
497495
export type RequestOpenRecordingPicker = { target_mode: RecordingTargetMode | null }
498496
export type RequestOpenSettings = { page: string }
499497
export type RequestScreenCapturePrewarm = { force?: boolean }
@@ -514,7 +512,7 @@ export type StartRecordingInputs = { capture_target: ScreenCaptureTarget; captur
514512
export type StereoMode = "stereo" | "monoL" | "monoR"
515513
export type StudioRecordingMeta = { segment: SingleSegment } | { inner: MultipleSegments }
516514
export type StudioRecordingStatus = { status: "InProgress" } | { status: "NeedsRemux" } | { status: "Failed"; error: string } | { status: "Complete" }
517-
export type SystemDiagnostics = { windowsVersion: WindowsVersionInfo | null; gpuInfo: GpuInfoDiag | null; allGpus: AllGpusInfo | null; renderingStatus: RenderingStatus; availableEncoders: string[]; graphicsCaptureSupported: boolean; d3D11VideoProcessorAvailable: boolean }
515+
export type SystemDiagnostics = { macosVersion: MacOSVersionInfo | null; availableEncoders: string[]; screenCaptureSupported: boolean }
518516
export type TargetUnderCursor = { display_id: DisplayId | null; window: WindowUnderCursor | null }
519517
export type TextSegment = { start: number; end: number; enabled?: boolean; content?: string; center?: XY<number>; size?: XY<number>; fontFamily?: string; fontSize?: number; fontWeight?: number; italic?: boolean; color?: string; fadeDuration?: number }
520518
export type TimelineConfiguration = { segments: TimelineSegment[]; zoomSegments: ZoomSegment[]; sceneSegments?: SceneSegment[]; maskSegments?: MaskSegment[]; textSegments?: TextSegment[] }
@@ -531,7 +529,6 @@ export type VideoUploadInfo = { id: string; link: string; config: S3UploadMeta }
531529
export type WindowExclusion = { bundleIdentifier?: string | null; ownerName?: string | null; windowTitle?: string | null }
532530
export type WindowId = string
533531
export type WindowUnderCursor = { id: WindowId; app_name: string; bounds: LogicalBounds }
534-
export type WindowsVersionInfo = { major: number; minor: number; build: number; displayName: string; meetsRequirements: boolean; isWindows11: boolean }
535532
export type XY<T> = { x: T; y: T }
536533
export type ZoomMode = "auto" | { manual: { x: number; y: number } }
537534
export type ZoomSegment = { start: number; end: number; amount: number; mode: ZoomMode }

0 commit comments

Comments
 (0)