mozilla / shumway

Shumway is a Flash VM and runtime written in JavaScript
Apache License 2.0
3.68k stars 396 forks source link

Incorrect Scaling #333

Open mbebenita opened 11 years ago

mbebenita commented 11 years ago

Scaling movie clips in Flash doesn't seem to scale the resulting stroked path the same way canvas does. It scales the path then strokes it. It computes a width for the stroke based on the scale style and strokes evenly. The easiest way to try this out is to draw a circle with a thick stroke then scale the shape in the X or Y direction.

magcius commented 11 years ago

It depends on the flags that are set. In the Flash authoring environment, click on your movie clip and there should be a "Scaling" combo box in the Properties pane. These set the NoHScaleFlag / NoVScaleFlag of LineStyle2.

mbebenita commented 11 years ago

These flags seem to compute the width of the entire stroke depending on the H or V scaling. In all cases, the stroke width is uniform. Currently, in Shumway, it looks like we first stroke then scale the stroked path which makes it look all distorted.

magcius commented 11 years ago

Well, that's not entirely true.

See http://cairographics.org/tutorial/#L2linewidth.

NoHScale / NoVScale being on would produce the former, and them being off would produce the latter.