Add Apple Icon preview

This commit is contained in:
Robin Ward 2016-09-19 14:24:37 -04:00
parent e7c1962aa0
commit 598db7a81c
3 changed files with 37 additions and 2 deletions

View File

@ -0,0 +1,35 @@
import { observes } from 'ember-addons/ember-computed-decorators';
import {
createPreviewComponent,
loadImage,
} from 'wizard/lib/preview';
export default createPreviewComponent(325, 125, {
ios: null,
image: null,
@observes('field.value')
imageChanged() {
this.reload();
},
load() {
return Ember.RSVP.Promise.all([
loadImage('/images/wizard/apple-mask.png'),
loadImage(this.get('field.value'))
]).then(result => {
this.ios = result[0];
this.image = result[1];
});
return loadImage(this.get('field.value')).then(image => {
this.image = image;
});
},
paint(ctx, colors, width, height) {
ctx.drawImage(this.image, 10, 8, 87, 87);
ctx.drawImage(this.ios, 0, 0, width, height);
}
});

View File

@ -16,8 +16,8 @@ export default createPreviewComponent(371, 124, {
load() {
return Ember.RSVP.Promise.all([
loadImage('/images/wizard/tab.png'),
loadImage(this.get('field.value'))
loadImage('/images/wizard/tab.png'),
loadImage(this.get('field.value'))
]).then(result => {
this.tab = result[0];
this.image = result[1];

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB