Error in description of attribute "scaled" of linear gradient fill

Regina Henschel 286 Reputation points
2025-05-12T09:01:15.8033333+00:00

The standard states for the attribute scaled of the element <lin> in §20.1.8.41 in ISO/IEC 29500-1:2016(E),

Mathematically, if this flag is true, then the gradient vector ( cos x , sin x ) is scaled by the width (w) and height (h) of the fill region, so that the vector becomes ( w cos x, h sin x ) (before normalization). Observe that now if the gradient angle is 45 degrees, the gradient vector is ( w, h ), which goes from top-left to bottom-right of the fill region.

In my understanding, the gradient vector is perpendicular to the vector of the line of constant color. Therefor the gradient vector becomes ( h cos x, w sin x) (before normalization).

The rendering in PowerPoint is correct, only the description in the standard is faulty.

How to test the behavior:

Draw a square, fill it with a linear gradient with angle 30°. To get a gradient with good visible line of constant color let two colors use the same position as in the example below.

<a:gsLst>
     <a:gs pos="0"><a:srgbClr val="FFFF00"/></a:gs>
     <a:gs pos="40000"><a:srgbClr val="FFFF00"/></a:gs>
     <a:gs pos="40000"><a:srgbClr val="0070C0"/></a:gs>
     <a:gs pos="100000"><a:srgbClr val="0070C0"/></a:gs>
</a:gsLst>

Create a bitmap from the shape and scale the bitmap to width=5cm and height=9cm. Now make a copy of the square shape and scale the shape to width=5cm and height=9cm. The gradient in the scaled shape is the same as in the square shape because as default scaled="0" is used.

Because the attribute scaled has no UI, open the file source and set the attribute on the scaled shape to scaled="1".

Open the changed file in PowerPoint. You will notice, that the gradient in the scaled shape is now the same as in the scaled image. Measure the gradient vector. You will find that it is parallel to vector
(9cm cos 30°, 5cm sin 30°).

Microsoft 365 and Office | Open Specifications
{count} votes

Accepted answer
  1. mkaszewiak 90 Reputation points Microsoft Employee Moderator
    2025-05-28T10:28:44.7766667+00:00

    Hi @Regina Henschel

    Thank you once again for your valuable input and all your efforts toward improving the documentation. We’ve reviewed your interpretation internally and can confirm that you are correct: the gradient vector becomes (h cos x, w sin x).

    I will proceed with requesting a documentation correction through the ISO working group.

    Best regards,

    Mariusz KaszewiakMicrosoft Open Specifications Support

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.