From 53983b6520fb5e2be8cbcd66c593d6fe4e660e55 Mon Sep 17 00:00:00 2001 From: liteng <930372551@qq.com> Date: Sun, 4 Nov 2018 21:17:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=BB=A4=E9=95=9C=E5=92=8C=E9=AB=98=E6=96=AF?= =?UTF-8?q?=E6=BB=A4=E9=95=9C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ShadowEditor.SVG/dist/ShadowEditor.SVG.js | 38 +++++++++++++ ShadowEditor.SVG/src/filter/SvgFilter.js | 22 ++++++++ ShadowEditor.SVG/src/filter/feGaussianBlur.js | 22 ++++++++ ShadowEditor.SVG/src/index.js | 3 + .../test/12 SvgGaussianBlurTest.html | 56 +++++++++++++++++++ 5 files changed, 141 insertions(+) create mode 100644 ShadowEditor.SVG/src/filter/SvgFilter.js create mode 100644 ShadowEditor.SVG/src/filter/feGaussianBlur.js create mode 100644 ShadowEditor.SVG/test/12 SvgGaussianBlurTest.html diff --git a/ShadowEditor.SVG/dist/ShadowEditor.SVG.js b/ShadowEditor.SVG/dist/ShadowEditor.SVG.js index 4d31c8bf..f0a0b193 100644 --- a/ShadowEditor.SVG/dist/ShadowEditor.SVG.js +++ b/ShadowEditor.SVG/dist/ShadowEditor.SVG.js @@ -626,6 +626,44 @@ UI.addXType('svguse', SvgUse); + /** + * SVG滤镜 + * @author tengge / https://github.com/tengge1 + * @param {*} options + */ + function SvgFilter(options = {}) { + Control.call(this, options); + } + + SvgFilter.prototype = Object.create(Control.prototype); + SvgFilter.prototype.constructor = SvgFilter; + + SvgFilter.prototype.render = function () { + var dom = document.createElementNS('http://www.w3.org/2000/svg', 'filter'); + this.renderDom(dom); + }; + + UI.addXType('svgfilter', SvgFilter); + + /** + * SVG高斯滤镜 + * @author tengge / https://github.com/tengge1 + * @param {*} options + */ + function feGaussianBlur(options = {}) { + Control.call(this, options); + } + + feGaussianBlur.prototype = Object.create(Control.prototype); + feGaussianBlur.prototype.constructor = feGaussianBlur; + + feGaussianBlur.prototype.render = function () { + var dom = document.createElementNS('http://www.w3.org/2000/svg', 'feGaussianBlur'); + this.renderDom(dom); + }; + + UI.addXType('svgfegaussianblur', feGaussianBlur); + exports.Control = Control; exports.UI = UI; diff --git a/ShadowEditor.SVG/src/filter/SvgFilter.js b/ShadowEditor.SVG/src/filter/SvgFilter.js new file mode 100644 index 00000000..3613a922 --- /dev/null +++ b/ShadowEditor.SVG/src/filter/SvgFilter.js @@ -0,0 +1,22 @@ +import { Control, UI } from '../third_party'; + +/** + * SVG滤镜 + * @author tengge / https://github.com/tengge1 + * @param {*} options + */ +function SvgFilter(options = {}) { + Control.call(this, options); +} + +SvgFilter.prototype = Object.create(Control.prototype); +SvgFilter.prototype.constructor = SvgFilter; + +SvgFilter.prototype.render = function () { + var dom = document.createElementNS('http://www.w3.org/2000/svg', 'filter'); + this.renderDom(dom); +}; + +UI.addXType('svgfilter', SvgFilter); + +export default SvgFilter; \ No newline at end of file diff --git a/ShadowEditor.SVG/src/filter/feGaussianBlur.js b/ShadowEditor.SVG/src/filter/feGaussianBlur.js new file mode 100644 index 00000000..95b9d159 --- /dev/null +++ b/ShadowEditor.SVG/src/filter/feGaussianBlur.js @@ -0,0 +1,22 @@ +import { Control, UI } from '../third_party'; + +/** + * SVG高斯滤镜 + * @author tengge / https://github.com/tengge1 + * @param {*} options + */ +function feGaussianBlur(options = {}) { + Control.call(this, options); +} + +feGaussianBlur.prototype = Object.create(Control.prototype); +feGaussianBlur.prototype.constructor = feGaussianBlur; + +feGaussianBlur.prototype.render = function () { + var dom = document.createElementNS('http://www.w3.org/2000/svg', 'feGaussianBlur'); + this.renderDom(dom); +}; + +UI.addXType('svgfegaussianblur', feGaussianBlur); + +export default feGaussianBlur; \ No newline at end of file diff --git a/ShadowEditor.SVG/src/index.js b/ShadowEditor.SVG/src/index.js index a1c8ed1a..3695bde4 100644 --- a/ShadowEditor.SVG/src/index.js +++ b/ShadowEditor.SVG/src/index.js @@ -13,4 +13,7 @@ import './SvgAnchor'; import './defs/SvgDefs'; import './defs/SvgUse'; +import './filter/SvgFilter'; +import './filter/feGaussianBlur'; + export { Control, UI } from './third_party'; \ No newline at end of file diff --git a/ShadowEditor.SVG/test/12 SvgGaussianBlurTest.html b/ShadowEditor.SVG/test/12 SvgGaussianBlurTest.html new file mode 100644 index 00000000..63e086d7 --- /dev/null +++ b/ShadowEditor.SVG/test/12 SvgGaussianBlurTest.html @@ -0,0 +1,56 @@ + + + + + + + 12 SvgGaussianBlurTest + + + + + + + + + \ No newline at end of file