2012-11-05 22:03:42 -05:00
|
|
|
/*
|
|
|
|
* Paper.js
|
|
|
|
*
|
|
|
|
* This file is part of Paper.js, a JavaScript Vector Graphics Library,
|
|
|
|
* based on Scriptographer.org and designed to be largely API compatible.
|
|
|
|
* http://paperjs.org/
|
|
|
|
* http://scriptographer.org/
|
|
|
|
*
|
|
|
|
* Copyright (c) 2011, Juerg Lehni & Jonathan Puckey
|
|
|
|
* http://lehni.org/ & http://jonathanpuckey.com/
|
|
|
|
*
|
|
|
|
* Distributed under the MIT license. See LICENSE file for details.
|
|
|
|
*
|
|
|
|
* All rights reserved.
|
|
|
|
*/
|
|
|
|
|
2012-11-05 21:58:16 -05:00
|
|
|
var SvgStyles = Base.each({
|
|
|
|
fillColor: 'fill',
|
|
|
|
strokeColor: 'stroke',
|
|
|
|
strokeWidth: 'stroke-width',
|
|
|
|
strokeCap: 'stroke-linecap',
|
|
|
|
strokeJoin: 'stroke-linejoin',
|
|
|
|
miterLimit: 'stroke-miterlimit',
|
|
|
|
dashArray: 'stroke-dasharray',
|
|
|
|
dashOffset: 'stroke-dashoffset'
|
|
|
|
}, function(attr, prop) {
|
2012-11-05 22:03:42 -05:00
|
|
|
var part = Base.capitalize(prop);
|
2012-11-05 21:58:16 -05:00
|
|
|
this.attributes[attr] = this.properties[prop] = {
|
|
|
|
type: /Color$/.test(prop)
|
|
|
|
? 'color'
|
|
|
|
: prop == 'dashArray'
|
|
|
|
? 'array'
|
|
|
|
: 'value',
|
|
|
|
property: prop,
|
|
|
|
attribute: attr,
|
2012-11-05 22:03:42 -05:00
|
|
|
get: 'get' + part,
|
|
|
|
set: 'set' + part
|
2012-11-05 21:58:16 -05:00
|
|
|
};
|
|
|
|
}, {
|
|
|
|
properties: {},
|
|
|
|
attributes: {}
|
|
|
|
});
|