Align patterns and gradients to a grid

This commit is contained in:
ahocevar
2018-05-22 16:05:32 +02:00
parent c32bd2274c
commit 7cfa65b8c3
6 changed files with 24 additions and 25 deletions

View File

@@ -456,8 +456,9 @@ CanvasReplay.prototype.beginGeometry = function(geometry, feature) {
*/
CanvasReplay.prototype.fill_ = function(context) {
if (this.fillOrigin_) {
const origin = applyTransform(this.renderedTransform_, this.fillOrigin_.slice());
context.translate(origin[0], origin[1]);
const origin = applyTransform(this.renderedTransform_, [0, 0]);
const repeatSize = 512 * this.pixelRatio;
context.translate(origin[0] % repeatSize, origin[1] % repeatSize);
context.rotate(this.viewRotation_);
}
context.fill();