mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2024-12-29 09:22:22 -05:00
Declare all classes as local variables, so they can be scoped.
This commit is contained in:
parent
c84df5a346
commit
941c3c7346
24 changed files with 25 additions and 26 deletions
|
@ -1,4 +1,4 @@
|
|||
Paper = Base.extend({
|
||||
var Paper = Base.extend({
|
||||
statics: {
|
||||
documents: [],
|
||||
activateDocument: function(doc) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Rectangle = Base.extend({
|
||||
var Rectangle = Base.extend({
|
||||
beans: true,
|
||||
|
||||
initialize: function() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Color = Base.extend({
|
||||
var Color = Base.extend({
|
||||
beans: true,
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Gradient = Base.extend({
|
||||
var Gradient = Base.extend({
|
||||
initialize: function() {
|
||||
this.stops = [new GradientStop('white', 0), new GradientStop('black', 1)];
|
||||
this.type = 'linear';
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
GradientColor = Color.extend({
|
||||
var GradientColor = Color.extend({
|
||||
beans: true,
|
||||
|
||||
initialize: function(gradient, origin, destination, hilite) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
GradientStop = Base.extend({
|
||||
var GradientStop = Base.extend({
|
||||
beans: true,
|
||||
|
||||
// TODO: support midPoint? (initial tests didn't look nice)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
GrayColor = Color.extend({
|
||||
var GrayColor = Color.extend({
|
||||
beans: true,
|
||||
|
||||
initialize: function() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
RGBColor = Color.extend(new function() {
|
||||
var RGBColor = Color.extend(new function() {
|
||||
// TODO: convert hex codes to [r,g,b]?
|
||||
var namedColors = {
|
||||
lightpink: 'FFB6C1', pink: 'FFC0CB', crimson: 'DC143C',
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Doc = Base.extend({
|
||||
var Doc = Base.extend({
|
||||
beans: true,
|
||||
|
||||
initialize: function(canvas) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
DocumentView = Base.extend({
|
||||
var DocumentView = Base.extend({
|
||||
beans: true,
|
||||
|
||||
initialize: function(document) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Symbol = Base.extend({
|
||||
var Symbol = Base.extend({
|
||||
beans: true,
|
||||
|
||||
initialize: function(item) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Group = Item.extend({
|
||||
var Group = Item.extend({
|
||||
beans: true,
|
||||
initialize: function(items) {
|
||||
this.base();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Item = Base.extend({
|
||||
var Item = Base.extend({
|
||||
beans: true,
|
||||
|
||||
initialize: function() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Layer = Group.extend({
|
||||
var Layer = Group.extend({
|
||||
beans: true,
|
||||
|
||||
initialize: function() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
PathStyle = Base.extend(new function() {
|
||||
var PathStyle = Base.extend(new function() {
|
||||
var keys = ['windingRule', 'resolution', 'strokeColor', 'strokeWidth',
|
||||
'strokeCap', 'strokeJoin', 'dashOffset','dashArray', 'miterLimit',
|
||||
'strokeOverprint', 'fillColor', 'fillOverprint'];
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
PlacedSymbol = Item.extend({
|
||||
var PlacedSymbol = Item.extend({
|
||||
beans: true,
|
||||
|
||||
initialize: function() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Raster = Item.extend({
|
||||
var Raster = Item.extend({
|
||||
beans: true,
|
||||
|
||||
// TODO: implement url / type, width, height
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
CompoundPath = PathItem.extend({
|
||||
var CompoundPath = PathItem.extend({
|
||||
initialize: function(items) {
|
||||
this.base();
|
||||
this.children = [];
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
Curve = Base.extend({
|
||||
var Curve = Base.extend({
|
||||
initialize: function() {
|
||||
},
|
||||
|
||||
|
||||
|
||||
statics: {
|
||||
read: function(args, index, length) {
|
||||
var index = index || 0, length = length || args.length - index;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Path = PathItem.extend({
|
||||
var Path = PathItem.extend({
|
||||
beans: true,
|
||||
|
||||
initialize: function(/* segments */) {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
PathItem = Item.extend({
|
||||
var PathItem = Item.extend({
|
||||
beans: true,
|
||||
|
||||
initialize: function() {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Segment = Base.extend({
|
||||
var Segment = Base.extend({
|
||||
initialize: function() {
|
||||
if (arguments.length == 0) {
|
||||
this.point = new Point();
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
Tool = ToolHandler.extend(new function() {
|
||||
var Tool = ToolHandler.extend(new function() {
|
||||
function viewToArtwork(event, document) {
|
||||
var point = Point.create(event.offset.x, event.offset.y);
|
||||
// TODO: always the active view?
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
ToolHandler = Base.extend({
|
||||
var ToolHandler = Base.extend({
|
||||
beans: true,
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue