Let a drawing run over as many pages as the note
The ink was stuck on page one while the writing carried on without it, which stopped making sense the moment a note could run to four pages. Every page is exported anyway, so every page can be drawn on. Pages are numbered the way the PDF reader numbers them, and only pages that carry ink are stored, so the keys are the drawn pages. While drawing there is always one blank page past the end: pages otherwise come from how far the writing runs, and to draw on page three you would first have had to write three pages. A drawing that lives entirely on page one is still written in the old single-page shape. Nothing requires that — it means an ordinary note is stored exactly as it always was, and a device running an older build still shows it. The bin clears the page being looked at. Undo and redo work on the drawing as a whole, because one Undo button that means four different things depending on where you scrolled is not a button anyone can use. And a real bug found on the way out: the exporter has written drawings/<note>.png since the interface was put into English, while the importer was still looking for zeichnungen/<note>.png. A drawing exported by this very app came back from its own archive as nothing at all. Both names are read now, and so are the further pages. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b8c5c42217
commit
228552d453
9 files changed
+671
-136
No files matched your search
+12
-3
@@ -33,7 +33,13 @@ import {
|
||||
import { EditorPane } from "./features/notes/EditorPane.jsx";
|
||||
import { HistoryModal } from "./features/notes/HistoryModal.jsx";
|
||||
import { DrawingLayer } from "./features/drawing/DrawingLayer.jsx";
|
||||
import { CANON_W, CANON_H, PREVIEW_DRAWING_W } from "./features/drawing/strokes.js";
|
||||
import {
|
||||
CANON_W,
|
||||
CANON_H,
|
||||
PREVIEW_DRAWING_W,
|
||||
drawnSheets,
|
||||
sheetStrokes,
|
||||
} from "./features/drawing/strokes.js";
|
||||
|
||||
/** Views that are not a notebook and therefore cannot hold a new note. */
|
||||
const VIRTUAL_FOLDERS = ["all", "starred", "trash", "dashboard"];
|
||||
@@ -760,9 +766,12 @@ export default function App() {
|
||||
data.setNoteContent(historyFor, content);
|
||||
setRestoreEpoch((e) => e + 1);
|
||||
}}
|
||||
renderDrawing={(strokes) => (
|
||||
/* The first drawn page stands for the drawing in a thumbnail this
|
||||
small. Asking for page one would show a blank sheet for a note whose
|
||||
ink starts on page three. */
|
||||
renderDrawing={(doc) => (
|
||||
<DrawingLayer
|
||||
strokes={strokes.strokes || []}
|
||||
strokes={sheetStrokes(doc, drawnSheets(doc)[0] ?? 1)}
|
||||
width={PREVIEW_DRAWING_W}
|
||||
height={Math.round((PREVIEW_DRAWING_W * CANON_H) / CANON_W)}
|
||||
zIndex={1}
|
||||
|
||||
Reference in new issue
Block a user