bugs fixes, docs updates. fix #535

This commit is contained in:
Anton Lavrenov
2019-01-11 08:51:46 -05:00
parent a3767bdf3d
commit 830eb53650
15 changed files with 268 additions and 31 deletions

View File

@@ -483,9 +483,14 @@ export class SceneContext extends Context {
if (fillPatternX || fillPatternY) {
this.translate(fillPatternX || 0, fillPatternY || 0);
}
if (fillPatternRotation) {
this.rotate(fillPatternRotation);
}
// TODO: optimize to fillPatternScaleX and fillPatternScaleY
// otherwise it is object (always true)
// do the same for offset
if (fillPatternScale) {
this.scale(fillPatternScale.x, fillPatternScale.y);
}
@@ -500,7 +505,7 @@ export class SceneContext extends Context {
shape.getFillPatternRepeat() || 'repeat'
)
);
this.fill();
shape._fillFunc(this);
}
_fillLinearGradient(shape) {
var start = shape.getFillLinearGradientStartPoint(),
@@ -537,7 +542,7 @@ export class SceneContext extends Context {
grd.addColorStop(colorStops[n], colorStops[n + 1]);
}
this.setAttr('fillStyle', grd);
this.fill();
shape._fillFunc(this);
}
_fill(shape) {
var hasColor = shape.fill(),