mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-28 06:59:45 -04:00
Merge pull request #378 from rschamp/bugfix/svg-costume-add
Fix adding SVG costumes
This commit is contained in:
commit
b2777aced1
1 changed files with 8 additions and 4 deletions
|
@ -329,13 +329,17 @@ RenderedTarget.prototype.setCostume = function (index) {
|
||||||
);
|
);
|
||||||
if (this.renderer) {
|
if (this.renderer) {
|
||||||
var costume = this.sprite.costumes[this.currentCostume];
|
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, {
|
this.renderer.updateDrawableProperties(this.drawableID, {
|
||||||
skin: costume.skin,
|
skin: costume.skin,
|
||||||
costumeResolution: costume.bitmapResolution,
|
costumeResolution: costume.bitmapResolution,
|
||||||
rotationCenter: [
|
rotationCenter: rotationCenter
|
||||||
costume.rotationCenterX / costume.bitmapResolution,
|
|
||||||
costume.rotationCenterY / costume.bitmapResolution
|
|
||||||
]
|
|
||||||
});
|
});
|
||||||
if (this.visible) {
|
if (this.visible) {
|
||||||
this.runtime.requestRedraw();
|
this.runtime.requestRedraw();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue