Merge pull request #378 from rschamp/bugfix/svg-costume-add

Fix adding SVG costumes
This commit is contained in:
Ray Schamp 2017-01-12 15:38:11 -05:00 committed by GitHub
commit b2777aced1

View file

@ -329,13 +329,17 @@ RenderedTarget.prototype.setCostume = function (index) {
);
if (this.renderer) {
var costume = this.sprite.costumes[this.currentCostume];
var rotationCenter = costume.bitmapResolution ? [
costume.rotationCenterX / costume.bitmapResolution,
costume.rotationCenterY / costume.bitmapResolution
] : [
costume.rotationCenterX,
costume.rotationCenterY
];
this.renderer.updateDrawableProperties(this.drawableID, {
skin: costume.skin,
costumeResolution: costume.bitmapResolution,
rotationCenter: [
costume.rotationCenterX / costume.bitmapResolution,
costume.rotationCenterY / costume.bitmapResolution
]
rotationCenter: rotationCenter
});
if (this.visible) {
this.runtime.requestRedraw();