mirror of
https://github.com/storytold/deckcraft.git
synced 2026-11-11 04:49:36 -06:00
Flip is refused on a SmartArt graphic instead of turning it into a plain group
PowerPoint greys Flip out for a SmartArt graphic (SmartArt Design ▸ Right to Left is the way to mirror it), also inside a group, as ungrouping would hand the flip to the graphic. Before, a flip turned it into a plain group that the smartArt.* commands then refused. arrange.flipHorizontal and flipVertical reach the check through shape.flip. Split out of the SmartArt PR at review. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
52f87aca13
commit
fe35df948c
@@ -191,6 +191,16 @@ pub(super) fn rotate(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
pub(super) fn flip(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
let v = str_param(p, "axis").unwrap_or("horizontal").starts_with('v');
|
||||
edit_geometry(s, p, "shape.flip", |sh| {
|
||||
// PowerPoint greys Flip out for a SmartArt graphic (SmartArt Design > Right to Left mirrors it),
|
||||
// also inside a group: ungrouping would hand the flip to the graphic.
|
||||
let mut graphic = false;
|
||||
deckcraft_model::walk(std::slice::from_ref(&*sh), &mut |x, _| graphic |= x.diagram.is_some());
|
||||
if graphic {
|
||||
return Err(bad(
|
||||
"shape.flip",
|
||||
"Flip is not available for a SmartArt graphic (it would turn it into a plain group); use `smartArt.layout` to change how it is laid out",
|
||||
));
|
||||
}
|
||||
if let Some(x) = sh.xfrm.as_mut() {
|
||||
if v {
|
||||
x.flip_v = !x.flip_v;
|
||||
|
||||
Reference in New Issue
Block a user