mirror of
https://github.com/storytold/wordcraft.git
synced 2026-12-05 04:07:03 -06:00
Merge pull request #9130
With AutoCraft's CI fix 680f106b for the pull requests merged with it.
This commit is contained in:
Generated
+1
-1
@@ -1496,7 +1496,7 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "craft-flags"
|
||||
version = "0.1.0"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=5299d8d97dc04648dff735d1bd6f60bd18f10b35#5299d8d97dc04648dff735d1bd6f60bd18f10b35"
|
||||
source = "git+https://github.com/storytold/craft-libs?rev=ad10c35ae545f0fb816364381a1a8154012b2359#ad10c35ae545f0fb816364381a1a8154012b2359"
|
||||
dependencies = [
|
||||
"craft-atomic",
|
||||
"dirs",
|
||||
|
||||
@@ -88,10 +88,30 @@ impl ThumbSource<usize> for SheetSource<'_> {
|
||||
}
|
||||
}
|
||||
}
|
||||
outline_sheet(&mut image);
|
||||
ThumbRender::Ready(image)
|
||||
}
|
||||
}
|
||||
|
||||
/// A one-pixel grey edge on the sheet. The pane's well is as white as the paper, so without it the sheet's
|
||||
/// own shape is invisible and a portrait page looks like a landscape sheet with the page off to one side (#9111).
|
||||
fn outline_sheet(image: &mut ColorImage) {
|
||||
// lean: fixed grey, not a theme token: the sheet is paper, white in every theme; a token needs a craft-libs pane overlay.
|
||||
const EDGE: Color32 = Color32::from_gray(150);
|
||||
let [w, h] = image.size;
|
||||
if w == 0 || h == 0 {
|
||||
return;
|
||||
}
|
||||
for x in 0..w {
|
||||
image.pixels[x] = EDGE;
|
||||
image.pixels[(h - 1) * w + x] = EDGE;
|
||||
}
|
||||
for y in 0..h {
|
||||
image.pixels[y * w] = EDGE;
|
||||
image.pixels[y * w + w - 1] = EDGE;
|
||||
}
|
||||
}
|
||||
|
||||
/// The preview (#1156): the sheet fills the pane, a bar below pages through the sheets and zooms; zoomed in,
|
||||
/// the sheet pans.
|
||||
pub(super) fn show(app: &mut WordApp, ui: &mut Ui, lay: &Arc<DocLayout>) {
|
||||
|
||||
Reference in New Issue
Block a user