mirror of
https://github.com/storytold/wordcraft.git
synced 2026-11-18 00:15:44 +00:00
This commit is contained in:
1 parent
a61cef5d45
commit
9144b9bfda
2 files changed
+40
-3
No files matched your search
@@ -1645,9 +1645,19 @@ fn shape(pen: &Pen, kind: &str) -> bool {
|
||||
"triangle" => solid(&[(10.0, 3.5), (17.0, 16.5), (3.0, 16.5)]),
|
||||
"diamond" => solid(&[(10.0, 3.0), (17.0, 10.0), (10.0, 17.0), (3.0, 10.0)]),
|
||||
"line" => pen.line(&[(4.0, 16.0), (16.0, 4.0)]),
|
||||
// The block arrow the tile inserts (#6768), from the outline the document draws it with.
|
||||
"arrow" => {
|
||||
pen.line(&[(4.0, 16.0), (14.5, 5.5)]);
|
||||
head((16.5, 3.5), (4.0, 16.0));
|
||||
let (x0, y0, w, h) = (3.0, 5.0, 14.0, 10.0);
|
||||
let pts: Vec<(f32, f32)> = wordcraft_doc::wrap::arrow_outline(wordcraft_doc::para::ShapeKind::Arrow, w, h)
|
||||
.iter()
|
||||
.map(|&(u, v)| (x0 + u * w, y0 + v * h))
|
||||
.collect();
|
||||
// Concave: the shaft and the head are tinted apart, then the outline.
|
||||
if let [tail_top, neck_top, barb_top, tip, barb_bottom, neck_bottom, tail_bottom] = pts[..] {
|
||||
pen.fill(&[tail_top, neck_top, neck_bottom, tail_bottom], tint);
|
||||
pen.fill(&[barb_top, tip, barb_bottom], tint);
|
||||
}
|
||||
pen.closed(&pts, c);
|
||||
}
|
||||
"star" => {
|
||||
let pts: Vec<(f32, f32)> = (0..10)
|
||||
@@ -1745,6 +1755,32 @@ mod tests {
|
||||
assert!(!has_default_highlight_bar("shadingNoBar"));
|
||||
}
|
||||
|
||||
/// #6768: the Insert › Shapes Arrow tile is the block arrow that tile inserts, outlined as the
|
||||
/// document draws it, not a thin line with a head.
|
||||
#[test]
|
||||
fn the_arrow_tile_is_the_block_arrow_it_inserts() {
|
||||
let ctx = egui::Context::default();
|
||||
let output = ctx.run_ui(egui::RawInput::default(), |ui| {
|
||||
paint(ui.painter(), Rect::from_min_size(Pos2::ZERO, egui::vec2(20.0, 20.0)), "shape.arrow", Color32::BLACK, Color32::BLUE);
|
||||
});
|
||||
let outline: Vec<Pos2> = output
|
||||
.shapes
|
||||
.iter()
|
||||
.find_map(|s| match &s.shape {
|
||||
// The outline, not the tinted fills (closed too, but without a stroke).
|
||||
Shape::Path(path) if path.closed && path.stroke.width > 0.0 => Some(path.points.clone()),
|
||||
_ => None,
|
||||
})
|
||||
.expect("the arrow is outlined");
|
||||
output.drop_without_applying_deltas();
|
||||
let want = wordcraft_doc::wrap::arrow_outline(wordcraft_doc::para::ShapeKind::Arrow, 14.0, 10.0);
|
||||
assert_eq!(outline.len(), want.len(), "{outline:?}");
|
||||
for (got, (u, v)) in outline.iter().zip(want) {
|
||||
let expected = pos2(3.0 + u * 14.0, 5.0 + v * 10.0);
|
||||
assert!(got.distance(expected) < 0.01, "{got:?} vs {expected:?}");
|
||||
}
|
||||
}
|
||||
|
||||
/// Verify that the fitOnePage vector icon renders without panics and emits shapes.
|
||||
#[test]
|
||||
fn fit_one_page_icon_paints_without_panic() {
|
||||
|
||||
+2
-1
@@ -1,6 +1,6 @@
|
||||
# UI parity with Microsoft Word
|
||||
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** trivial (while editing a header or footer, a click on its Behind Text picture selects it wherever no header or footer line's band (plus 40pt) covers it, down over the body or in a clear area inside the band, and a right-click selects it too so Reset Picture and Wrap Text act on it); previously trivial (File › Print opened again no longer shows the last job's "submitted" or failure message when that window already said it; decided per window, the shared message and `ui.printSettings` untouched); previously trivial (Save As and Export offer Browse in WordCraft… on Linux/BSD, as Open does, #3535); previously trivial (Language dialog: whole-document OK sends Do not check only when the box was clicked, so per-run proofing state is not flattened; glossary skipped while Track Formatting is on and reported as `glossarySkipped`, #3518); previously trivial (Language dialog: Apply to the whole document sets the proofing language or no-proof for every story in one undo step, #3518); previously trivial (Ctrl/Cmd+Shift+V pastes the formatting picked up with Ctrl/Cmd+Shift+C or the Format Painter, or text only when none was, as in Word, #1537); previously trivial (Auto interface size capped to the screen, Ctrl+Shift+0 returns to Auto, #4030); previously trivial (clipboard: a copied picture reaches the system clipboard as PNG, with HTML where the host writes it, while a copy of only shapes stays in WordCraft, #6205); previously trivial (Save As on Linux: the desktop portal's Save dialog reports the file type picked, updating the extension so saving as PDF writes a .pdf, #6180); previously trivial (Vertical scrollbar track: clicking above the elevator moves one screen up and clicking below it moves one screen down, as in Word (#5853)); previously trivial (a press the canvas handles, such as Ctrl+click on a link, no longer also shows the link tooltip that frame, #4683); previously trivial (the window moves by its title bar behind a modal dialog, as in Word for Mac, #5124); previously trivial (pointer zoom stretches page rasters until it stops); previously trivial (dark-theme interface text on Linux and the BSDs no longer looks semi-bold); previously trivial (the document's scroll bars show wherever the pointer is, not only at the window's edge, #5746); previously trivial (Protected typing boundary lookup counts preceding objects once and indexes editable permission IDs (#3614); caret movement and enforcement policy are unchanged; previously trivial: Custom Document Properties dialog from File › Info › Properties › Advanced Properties…, #2982; previously trivial: View › Window › New Window opens another window on the document, each with its own caret and view; previously trivial: mail merge: First Record, Last Record and a record number box in Preview Results; Finish & Merge asks which records to merge or print, #3028; previously trivial: selection bar for right-to-left paragraphs and table rows; previously trivial: read only and comments-only protection grey out edits; previously trivial: the Font dialog previews "NaN" or "inf" in the Size box at 12 pt, #3663; previously trivial: File › Options disables the User name field while Restrict Editing is active; previously trivial: while editing a header or footer, a click in the other one edits it there without scrolling; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: Insert Table of Figures dialog: any caption label, #3013; previously trivial: Home › Underline drop-down shows its lines, #2738; previously trivial: the text context menu includes the formatting mini toolbar, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: the scrollbar page tip stays on one line as the page number grows, #3341; previously trivial: File › Home and New: templates and recent documents are buttons named for screen readers, #3176; previously trivial: forms protection greys out the Developer tab's control buttons and Properties; previously trivial: AltGr doesn't open KeyTips, #2388; previously trivial: closing the header or footer puts the caret back where it was in the body, #3331; previously trivial: Format Page Numbers dialog: number format and Continue from previous section / Start at, #1113; previously trivial: inline pictures drag to a dashed insertion cursor and stay inline, #2233, #2234; previously trivial: Save Changes prompt: a text file saved over itself closes, #2376; previously trivial: the equation being edited is framed as in Word: an outline as tall as its line, a grip, an options strip that opens its menu, and its current argument shaded; previously trivial: the table handles show while the caret is in the table, #2428; previously trivial: legacy menu keys, #1697; previously trivial: Shape Fill › Gradient and the Format Shape paneLine truncated
|
||||
> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-11-16 · **Change:** trivial (the Insert › Shapes Arrow tile is drawn as the block arrow it inserts, not a thin line arrow, #6768); previously trivial (while editing a header or footer, a click on its Behind Text picture selects it wherever no header or footer line's band (plus 40pt) covers it, down over the body or in a clear area inside the band, and a right-click selects it too so Reset Picture and Wrap Text act on it); previously trivial (File › Print opened again no longer shows the last job's "submitted" or failure message when that window already said it; decided per window, the shared message and `ui.printSettings` untouched); previously trivial (Save As and Export offer Browse in WordCraft… on Linux/BSD, as Open does, #3535); previously trivial (Language dialog: whole-document OK sends Do not check only when the box was clicked, so per-run proofing state is not flattened; glossary skipped while Track Formatting is on and reported as `glossarySkipped`, #3518); previously trivial (Language dialog: Apply to the whole document sets the proofing language or no-proof for every story in one undo step, #3518); previously trivial (Ctrl/Cmd+Shift+V pastes the formatting picked up with Ctrl/Cmd+Shift+C or the Format Painter, or text only when none was, as in Word, #1537); previously trivial (Auto interface size capped to the screen, Ctrl+Shift+0 returns to Auto, #4030); previously trivial (clipboard: a copied picture reaches the system clipboard as PNG, with HTML where the host writes it, while a copy of only shapes stays in WordCraft, #6205); previously trivial (Save As on Linux: the desktop portal's Save dialog reports the file type picked, updating the extension so saving as PDF writes a .pdf, #6180); previously trivial (Vertical scrollbar track: clicking above the elevator moves one screen up and clicking below it moves one screen down, as in Word (#5853)); previously trivial (a press the canvas handles, such as Ctrl+click on a link, no longer also shows the link tooltip that frame, #4683); previously trivial (the window moves by its title bar behind a modal dialog, as in Word for Mac, #5124); previously trivial (pointer zoom stretches page rasters until it stops); previously trivial (dark-theme interface text on Linux and the BSDs no longer looks semi-bold); previously trivial (the document's scroll bars show wherever the pointer is, not only at the window's edge, #5746); previously trivial (Protected typing boundary lookup counts preceding objects once and indexes editable permission IDs (#3614); caret movement and enforcement policy are unchanged; previously trivial: Custom Document Properties dialog from File › Info › Properties › Advanced Properties…, #2982; previously trivial: View › Window › New Window opens another window on the document, each with its own caret and view; previously trivial: mail merge: First Record, Last Record and a record number box in Preview Results; Finish & Merge asks which records to merge or print, #3028; previously trivial: selection bar for right-to-left paragraphs and table rows; previously trivial: read only and comments-only protection grey out edits; previously trivial: the Font dialog previews "NaN" or "inf" in the Size box at 12 pt, #3663; previously trivial: File › Options disables the User name field while Restrict Editing is active; previously trivial: while editing a header or footer, a click in the other one edits it there without scrolling; previously trivial: explicit documents keep the editor when recovery discovery finishes; readable recovery controls; previously trivial: Insert Table of Figures dialog: any caption label, #3013; previously trivial: Home › Underline drop-down shows its lines, #2738; previously trivial: the text context menu includes the formatting mini toolbar, #2959; previously trivial: personal templates in File › New and Save as Word Template, #2852; previously trivial: the scrollbar page tip stays on one line as the page number grows, #3341; previously trivial: File › Home and New: templates and recent documents are buttons named for screen readers, #3176; previously trivial: forms protection greys out the Developer tab's control buttons and Properties; previously trivial: AltGr doesn't open KeyTips, #2388; previously trivial: closing the header or footer puts the caret back where it was in the body, #3331; previously trivial: Format Page Numbers dialog: number format and Continue from previous section / Start at, #1113; previously trivial: inline pictures drag to a dashed insertion cursor and stay inline, #2233, #2234; previously trivial: Save Changes prompt: a text file saved over itself closes, #2376; previously trivial: the equation being edited is framed as in Word: an outline as tall as its line, a grip, an options strip that opens its menu, and its current argument shaded; previously trivial: the table handles show while the caret is in the tablLine truncated
|
||||
|
||||
> **Page Setup update:** 2026-11-07 · Page Setup number boxes keep long input inside the field, including accepted margin values after focus leaves (#5650); accepted ranges and readiness estimates are unchanged.
|
||||
|
||||
@@ -128,6 +128,7 @@ Page Setup's margin, paper-size and document-grid number boxes scroll long text
|
||||
|
||||
| Date | Change | Summary |
|
||||
|---|---|---|
|
||||
| 2026-11-16 | trivial | Insert › Shapes: the Arrow tile is drawn as the block arrow it inserts, from the outline the document draws it with, instead of a thin line with a head (#6768) |
|
||||
| 2026-11-15 | trivial | Header/footer pictures: while editing the header or footer, a click on its Behind Text picture selects it wherever no header or footer text covers it: drawn down over the body (anchored in the header, positioned outside the band) or in a clear area inside the band. What counts as header or footer text is each line's own band (the width available to it, so a centred or right-aligned line covers the empty space beside its ink, while an indent or a float beside the line narrows it) plus a 40pt margin either side; a drag there moves it, and a right-click selects it so Reset Picture and Wrap Text act on it. Over header or footer text the click still goes to the text, and from the body a click there is still body text (`canvas::tests::header_picture_clear_of_header_text_is_selected_while_editing_the_header`, `canvas::tests::footer_picture_clear_of_footer_text_is_selected_while_editing_the_footer`, `canvas::tests::right_clicking_a_repeated_header_picture_selects_it_on_its_own_page`, `tests::header_text_covers_the_whole_band_of_centred_and_right_lines`) |
|
||||
| 2026-11-15 | trivial | File › Print opened again no longer shows how the last job went ("Print job submitted…", a failure): that was said once in the status bar. A failure that comes in while the page is open stays, and printer status (finding printers, none found) shows each time. Decided per window: a result a window never said (it arrived under File's other pages, or in another window) still shows there, and the shared message that `ui.printSettings` reports is never cleared |
|
||||
| 2026-11-14 | trivial | Save As and Export (also the formats on the Print page) offer Browse in WordCraft… on Linux/BSD, as Open does; exporting there lists Export's formats as the types, whose extension replaces a known document extension on the name; an export refusal or failure shows on the Export page, as Save As's does (#3535) |
|
||||
|
||||
Reference in new issue
Block a user