diff --git a/check_targets.jai b/check_targets.jai index b7e0b6d..814b49d 100644 --- a/check_targets.jai +++ b/check_targets.jai @@ -47,7 +47,7 @@ APP_NAME :: "mcap"; APP_FOLDER_NAME :: "mcap"; GIT_BRANCH :: "check"; GIT_HASH :: "-"; -VERSION :: "0.1.21"; +VERSION :: "0.1.22"; BUILD_DATE :: "-"; DEBUG :: true; COMPILE_TESTS :: true; diff --git a/first.jai b/first.jai index 299c42d..31e44c7 100644 --- a/first.jai +++ b/first.jai @@ -8,7 +8,7 @@ APP_NAME :: "mcap"; APP_FOLDER_NAME :: "mcap"; APP_BUNDLE_IDENTIFIER :: "com.example.mcap"; -VERSION :: "0.1.21"; +VERSION :: "0.1.22"; // Where everything goes: bin/, or bin-headless/ for builds made with no_crash_dialog, so automated // builds never write over the ones you run by hand. build_directory := "bin"; diff --git a/src/app/ocr_ui.jai b/src/app/ocr_ui.jai index 225739b..ffbe106 100644 --- a/src/app/ocr_ui.jai +++ b/src/app/ocr_ui.jai @@ -824,6 +824,8 @@ ocr_ui_frame :: () { using ImGui; if section && viewer.full_index >= 0 { Separator(); Text("Text of % (% , % lines):", viewer.captures[viewer.full_index].name, section.model, section.lines.count); + SameLine(); + if SmallButton("Copy all text") ocr_copy_all_text(section); BeginChild("ocr text"); for section.lines TextUnformatted(it.text); EndChild(); @@ -850,6 +852,17 @@ text_with_links :: (text: string) { using ImGui; // ---------------------------------------------------------------- the Capture window +// Puts the reading on the clipboard, a line of text to each of its lines. +ocr_copy_all_text :: (section: *Mcap_Ocr_Section) { + builder: String_Builder; + builder.allocator = temp; + for section.lines { + if it_index append(*builder, "\n"); + append(*builder, it.text); + } + clipboard_set_text(builder_to_string(*builder,, temp)); +} + // The reading shown over the capture in the Capture window: the overlay's choice, else the chosen // model's, else the first there is. ocr_overlay_section :: () -> *Mcap_Ocr_Section { @@ -911,6 +924,8 @@ ocr_ui_capture_controls :: (index: s32, path: string) { using ImGui; SameLine(); } Checkbox("Boxes", *ocr_ui.show_boxes); + SameLine(); + if SmallButton("Copy all text") ocr_copy_all_text(section); if viewer.search_terms.count { matches := 0; for section.lines if search_line_matches(it.text, viewer.search_terms) matches += 1;