-
Notifications
You must be signed in to change notification settings - Fork 45
Closed
Labels
Description
Steps to reproduce:
Try to create a Gradient Fill using the following code -
sketch.addLayerStyle(
SharedStyle.LayerStyle({
id: <id>,
name: <name>,
fills: [
new Fill(null, {
fillType: 'Gradient',
gradient: {
gradientType: Gradient.GradientType.Linear,
from: '{0, 0}',
to: '{1, 1}',
stops: [ ... ]
}
})
]
})
);
Observed: The Layer Style is created with the default Gradient values (from: '{0.5, 0}', to: '{0.5, 1}', gradientType: 1, ...).
Expected: The Layer Style is created with the provided Gradient values (from: '{0, 0}', to: '{1, 1}', gradientType: 0, ...).
Version used: 1.25.0.
Technical details:
When creating a LayerStyle with Fill of type Gradient using its c'tor (SharedStyle.LayerStyle({...})),
It (internally )tries to use the Gradient c'tor using the args c'tor (and not the json c'tor).
But since args is not used in the Gradient c'tor, it is always created with the default values (instead of the values provided.