Sha256: e7df1a6472e1c34b253467aa93cfd1dee28878c39c926b39a8b65bac54ed4bb3

Contents?: true

Size: 770 Bytes

Versions: 7

Compression:

Stored size: 770 Bytes

Contents

/*
---
 
script: Shadow.Blur.js
 
description: SVG Filter powered shadow
 
license: Public domain (http://unlicense.org).

authors: Yaroslaff Fedin
 
requires:
- LSD.Layer.Shadow
 
provides: [LSD.Layer.Shadow.Blur]
 
...
*/

LSD.Layer.Shadow.Blur = new Class({
  //Extends: LSD.Layer.Shadow,

  paint: function(color, blur, x, y, stroke) {
    this.produce(stroke);
    this.shape.fill.apply(this.shape, color ? $splat(color) : null);
    if (blur > 0) this.shape.blur(blur);
    else this.shape.unblur();
    return {
      move: {
        x: x + blur, 
        y: y + blur
      },
      outside: {
        left: Math.max(blur - x, 0),
        top: Math.max(blur - y, 0),
        right: Math.max(blur + x, 0),
        bottom: Math.max(blur + y, 0)
      }
    }
  }
})

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
lsd_rails-0.1.6 Packages/lsd/Source/Layer/Shadow.Blur.js
lsd_rails-0.1.5 Packages/lsd/Source/Layer/Shadow.Blur.js
lsd_rails-0.1.4 Packages/lsd/Source/Layer/Shadow.Blur.js
lsd_rails-0.1.3 Packages/lsd/Source/Layer/Shadow.Blur.js
lsd_rails-0.1.2 Packages/lsd/Source/Layer/Shadow.Blur.js
lsd_rails-0.1.1 Packages/lsd/Source/Layer/Shadow.Blur.js
lsd_rails-0.1 Packages/lsd/Source/Layer/Shadow.Blur.js