mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-15 15:55:15 +00:00
craft-docx: gradient fills through craft-drawingml, Word's defaults in the mapping * craft-drawingml: a gradient keeps what the file says, and no more - shape is None when the file has neither a:lin nor a:path, and rotate_with_shape is None when it has no rotWithShape: each app applies its own default (PowerPoint draws such a gradient top to bottom and rotated with the shape; Word left to right and not rotated). - The stops are kept in file order, so a write gives them back as they were; Gradient::sorted_stops gives them by position for drawing. The writer writes no a:lin, a:path or rotWithShape where there is none. A model saved before reads as it did (rotateWithShape missing is Some(true)). * craft-docx: gradient fills read by craft-drawingml, with Word's defaults craft_drawingml::read::gradient gives the shape, focus, tile, flip, rotation and stop positions as the file states them; this crate applies Word's defaults where the file says nothing (a left-to-right linear gradient, not rotated with the shape) and resolves the stop colours against the document's theme and phClr, as before. The gradient fixtures read as they did.