mirror of
https://github.com/PR0M3TH3AN/unredact.git
synced 2026-10-27 08:40:29 +00:00
feat: spot redactions now created as analyzed with full data
Co-Authored-By: Claude Opus 4.6 <[email protected]>
This commit is contained in:
1 parent
7331fc5936
commit
9b9618d9fa
1 file changed
+20
-3
+20
-3
@@ -361,12 +361,29 @@ canvas.addEventListener("dblclick", async (e) => {
|
||||
return;
|
||||
}
|
||||
const r = await resp.json();
|
||||
state.redactions[r.id] = {
|
||||
|
||||
const redaction = {
|
||||
id: r.id, x: r.x, y: r.y, w: r.w, h: r.h,
|
||||
page: state.currentPage,
|
||||
status: "unanalyzed",
|
||||
analysis: null, solution: null, preview: null,
|
||||
status: r.analysis ? "analyzed" : "unanalyzed",
|
||||
analysis: r.analysis || null,
|
||||
solution: null,
|
||||
preview: null,
|
||||
};
|
||||
|
||||
if (r.analysis) {
|
||||
redaction.overrides = {
|
||||
fontId: r.analysis.font.id,
|
||||
fontSize: r.analysis.font.size,
|
||||
offsetX: r.analysis.offset_x || 0,
|
||||
offsetY: r.analysis.offset_y || 0,
|
||||
gapWidth: r.analysis.gap.w,
|
||||
leftText: r.analysis.segments[0]?.text || "",
|
||||
rightText: r.analysis.segments[1]?.text || "",
|
||||
};
|
||||
}
|
||||
|
||||
state.redactions[r.id] = redaction;
|
||||
renderRedactionList();
|
||||
renderCanvas();
|
||||
activateRedaction(r.id);
|
||||
|
||||
Reference in new issue
Block a user