Skip to content

Commit

Permalink
Fix bug where buttons were not created properly from selections.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luxapodular committed Sep 29, 2020
1 parent 23ff1fa commit f9bf651
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 48 deletions.
34 changes: 24 additions & 10 deletions engine/dist/emptyproject.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<!-- The Wick Engine build is injected here during the engine build step (see gulpfile.js) -->
<script>
/*Wick Engine https://github.com/Wicklets/wick-engine*/
var WICK_ENGINE_BUILD_VERSION = "2020.9.28.15.26.35";
var WICK_ENGINE_BUILD_VERSION = "2020.9.29.19.26.19";
/*!
* Paper.js v0.12.4 - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
Expand Down Expand Up @@ -50553,16 +50553,30 @@
return;
}

var clip = new Wick[args.type]({
identifier: args.identifier,
transformation: new Wick.Transformation({
x: this.selection.x + this.selection.width / 2,
y: this.selection.y + this.selection.height / 2
})
}); // Add the clip to the frame prior to adding objects.
let clip;

if (args.type === 'Button') {
clip = new Wick[args.type]({
identifier: args.identifier,
transformation: new Wick.Transformation({
x: this.selection.x + this.selection.width / 2,
y: this.selection.y + this.selection.height / 2
}),
objects: this.selection.getSelectedObjects('Canvas')
});
} else {
clip = new Wick[args.type]({
identifier: args.identifier,
transformation: new Wick.Transformation({
x: this.selection.x + this.selection.width / 2,
y: this.selection.y + this.selection.height / 2
})
});
clip.addObjects(this.selection.getSelectedObjects('Canvas'));
} // Add the clip to the frame prior to adding objects.


this.activeFrame.addClip(clip);
clip.addObjects(this.selection.getSelectedObjects('Canvas')); // TODO add to asset library
this.activeFrame.addClip(clip); // TODO add to asset library

this.selection.clear();
this.selection.select(clip);
Expand Down
34 changes: 24 additions & 10 deletions engine/dist/wickengine.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*Wick Engine https://github.com/Wicklets/wick-engine*/
var WICK_ENGINE_BUILD_VERSION = "2020.9.28.15.26.35";
var WICK_ENGINE_BUILD_VERSION = "2020.9.29.19.26.19";
/*!
* Paper.js v0.12.4 - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
Expand Down Expand Up @@ -50538,16 +50538,30 @@ Wick.Project = class extends Wick.Base {
return;
}

var clip = new Wick[args.type]({
identifier: args.identifier,
transformation: new Wick.Transformation({
x: this.selection.x + this.selection.width / 2,
y: this.selection.y + this.selection.height / 2
})
}); // Add the clip to the frame prior to adding objects.
let clip;

if (args.type === 'Button') {
clip = new Wick[args.type]({
identifier: args.identifier,
transformation: new Wick.Transformation({
x: this.selection.x + this.selection.width / 2,
y: this.selection.y + this.selection.height / 2
}),
objects: this.selection.getSelectedObjects('Canvas')
});
} else {
clip = new Wick[args.type]({
identifier: args.identifier,
transformation: new Wick.Transformation({
x: this.selection.x + this.selection.width / 2,
y: this.selection.y + this.selection.height / 2
})
});
clip.addObjects(this.selection.getSelectedObjects('Canvas'));
} // Add the clip to the frame prior to adding objects.


this.activeFrame.addClip(clip);
clip.addObjects(this.selection.getSelectedObjects('Canvas')); // TODO add to asset library
this.activeFrame.addClip(clip); // TODO add to asset library

this.selection.clear();
this.selection.select(clip);
Expand Down
29 changes: 21 additions & 8 deletions engine/src/base/Project.js
Original file line number Diff line number Diff line change
Expand Up @@ -1103,17 +1103,30 @@ Wick.Project = class extends Wick.Base {
return;
}

var clip = new Wick[args.type]({
identifier: args.identifier,
transformation: new Wick.Transformation({
x: this.selection.x + this.selection.width / 2,
y: this.selection.y + this.selection.height / 2,
}),
});
let clip;

if (args.type === 'Button') {
clip = new Wick[args.type]({
identifier: args.identifier,
transformation: new Wick.Transformation({
x: this.selection.x + this.selection.width / 2,
y: this.selection.y + this.selection.height / 2,
}),
objects: this.selection.getSelectedObjects('Canvas')
});
} else {
clip = new Wick[args.type]({
identifier: args.identifier,
transformation: new Wick.Transformation({
x: this.selection.x + this.selection.width / 2,
y: this.selection.y + this.selection.height / 2,
})
});
clip.addObjects(this.selection.getSelectedObjects('Canvas'));
}

// Add the clip to the frame prior to adding objects.
this.activeFrame.addClip(clip);
clip.addObjects(this.selection.getSelectedObjects('Canvas'));

// TODO add to asset library
this.selection.clear();
Expand Down
34 changes: 24 additions & 10 deletions public/corelibs/wick-engine/emptyproject.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<!-- The Wick Engine build is injected here during the engine build step (see gulpfile.js) -->
<script>
/*Wick Engine https://github.com/Wicklets/wick-engine*/
var WICK_ENGINE_BUILD_VERSION = "2020.9.28.15.26.35";
var WICK_ENGINE_BUILD_VERSION = "2020.9.29.19.26.19";
/*!
* Paper.js v0.12.4 - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
Expand Down Expand Up @@ -50553,16 +50553,30 @@
return;
}

var clip = new Wick[args.type]({
identifier: args.identifier,
transformation: new Wick.Transformation({
x: this.selection.x + this.selection.width / 2,
y: this.selection.y + this.selection.height / 2
})
}); // Add the clip to the frame prior to adding objects.
let clip;

if (args.type === 'Button') {
clip = new Wick[args.type]({
identifier: args.identifier,
transformation: new Wick.Transformation({
x: this.selection.x + this.selection.width / 2,
y: this.selection.y + this.selection.height / 2
}),
objects: this.selection.getSelectedObjects('Canvas')
});
} else {
clip = new Wick[args.type]({
identifier: args.identifier,
transformation: new Wick.Transformation({
x: this.selection.x + this.selection.width / 2,
y: this.selection.y + this.selection.height / 2
})
});
clip.addObjects(this.selection.getSelectedObjects('Canvas'));
} // Add the clip to the frame prior to adding objects.


this.activeFrame.addClip(clip);
clip.addObjects(this.selection.getSelectedObjects('Canvas')); // TODO add to asset library
this.activeFrame.addClip(clip); // TODO add to asset library

this.selection.clear();
this.selection.select(clip);
Expand Down
34 changes: 24 additions & 10 deletions public/corelibs/wick-engine/wickengine.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*Wick Engine https://github.com/Wicklets/wick-engine*/
var WICK_ENGINE_BUILD_VERSION = "2020.9.28.15.26.35";
var WICK_ENGINE_BUILD_VERSION = "2020.9.29.19.26.19";
/*!
* Paper.js v0.12.4 - The Swiss Army Knife of Vector Graphics Scripting.
* http://paperjs.org/
Expand Down Expand Up @@ -50538,16 +50538,30 @@ Wick.Project = class extends Wick.Base {
return;
}

var clip = new Wick[args.type]({
identifier: args.identifier,
transformation: new Wick.Transformation({
x: this.selection.x + this.selection.width / 2,
y: this.selection.y + this.selection.height / 2
})
}); // Add the clip to the frame prior to adding objects.
let clip;

if (args.type === 'Button') {
clip = new Wick[args.type]({
identifier: args.identifier,
transformation: new Wick.Transformation({
x: this.selection.x + this.selection.width / 2,
y: this.selection.y + this.selection.height / 2
}),
objects: this.selection.getSelectedObjects('Canvas')
});
} else {
clip = new Wick[args.type]({
identifier: args.identifier,
transformation: new Wick.Transformation({
x: this.selection.x + this.selection.width / 2,
y: this.selection.y + this.selection.height / 2
})
});
clip.addObjects(this.selection.getSelectedObjects('Canvas'));
} // Add the clip to the frame prior to adding objects.


this.activeFrame.addClip(clip);
clip.addObjects(this.selection.getSelectedObjects('Canvas')); // TODO add to asset library
this.activeFrame.addClip(clip); // TODO add to asset library

this.selection.clear();
this.selection.select(clip);
Expand Down

0 comments on commit f9bf651

Please sign in to comment.