关于PresetShapeDefinitions.xml中LeftArrow预设形状公式内dy属性未定义的技术问询
dy Property in LeftArrow Preset Shape Hey there, let's clarify where that dy property comes from—it's actually not defined in the <gdLst> section of your LeftArrow shape, and that's intentional!
What is dy?
dy is a predefined global geometric parameter in OpenXML DrawingML, meaning it's a universal value available to all preset shapes without needing to be explicitly declared in individual shape definitions. It represents half the total height of the shape, so mathematically:
dy = h / 2
Where h is another predefined parameter for the shape's full height.
Other Common Predefined Parameters
You'll see many of these used in your LeftArrow code too:
w: Total width of the shapeh: Total height of the shapel: X-coordinate of the shape's left edget: Y-coordinate of the shape's top edger: X-coordinate of the shape's right edgeb: Y-coordinate of the shape's bottom edgevc: Y-coordinate of the shape's vertical center (equalst + dy)hc: X-coordinate of the shape's horizontal center
Checking Your LeftArrow Code
Looking at your formula for y1:
<gd name="y1" fmla="+- vc 0 dy" />
This simplifies to vc - dy, which equals t (the top edge of the shape)—perfectly aligns with what dy represents as half the height.
Your Original LeftArrow Shape Definition
Here's your code formatted for clarity:
<leftArrow> <avLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main"> <gd name="adj1" fmla="val 50000" /> <gd name="adj2" fmla="val 50000" /> </avLst> <gdLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main"> <gd name="maxAdj2" fmla="*/ 100000 w ss" /> <gd name="a1" fmla="pin 0 adj1 100000" /> <gd name="a2" fmla="pin 0 adj2 maxAdj2" /> <gd name="dx2" fmla="*/ ss a2 100000" /> <gd name="x2" fmla="+- l dx2 0" /> <gd name="dy1" fmla="*/ h a1 200000" /> <gd name="y1" fmla="+- vc 0 dy" /> <!-- Where define the dy property --> <gd name="y2" fmla="+- vc dy1 0" /> <gd name="dx1" fmla="*/ y1 dx2 hd2" /> <gd name="x1" fmla="+- x2 0 dx1" /> </gdLst> <ahLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main"> <ahXY gdRefY="adj1" minY="0" maxY="100000"> <pos x="r" y="y1" /> </ahXY> <ahXY gdRefX="adj2" minX="0" maxX="maxAdj2"> <pos x="x2" y="t" /> </ahXY> </ahLst> <cxnLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main"> <cxn ang="3cd4"> <pos x="x2" y="t" /> </cxn> <cxn ang="cd2"> <pos x="l" y="vc" /> </cxn> <cxn ang="cd4"> <pos x="x2" y="b" /> </cxn> <cxn ang="0"> <pos x="r" y="vc" /> </cxn> </cxnLst> <rect l="x1" t="y1" r="r" b="y2" xmlns="http://schemas.openxmlformats.org/drawingml/2006/main" /> <pathLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main"> <path> <moveTo> <pt x="l" y="vc" /> </moveTo> <lnTo> <pt x="x2" y="t" /> </lnTo> <lnTo> <pt x="x2" y="y1" /> </lnTo> <lnTo> <pt x="r" y="y1" /> </lnTo> <lnTo> <pt x="r" y="y2" /> </lnTo> <lnTo> <pt x="x2" y="y2" /> </lnTo> <lnTo> <pt x="x2" y="b" /> </lnTo> <close /> </path> </pathLst> </leftArrow>
内容的提问来源于stack exchange,提问作者lindexi




