mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-23 06:23:37 -05:00
Pass rotation center and bitmap resolution to renderer (#288)
This commit is contained in:
parent
0cf21b26f0
commit
9af9a87cb6
1 changed files with 8 additions and 2 deletions
|
@ -302,8 +302,11 @@ Clone.prototype.setCostume = function (index) {
|
|||
index, 0, this.sprite.costumes.length - 1
|
||||
);
|
||||
if (this.renderer) {
|
||||
var costume = this.sprite.costumes[this.currentCostume];
|
||||
this.renderer.updateDrawableProperties(this.drawableID, {
|
||||
skin: this.sprite.costumes[this.currentCostume].skin
|
||||
skin: costume.skin,
|
||||
costumeResolution: costume.bitmapResolution,
|
||||
rotationCenter: [costume.rotationCenterX, costume.rotationCenterY]
|
||||
});
|
||||
if (this.visible) {
|
||||
this.runtime.requestRedraw();
|
||||
|
@ -356,12 +359,15 @@ Clone.prototype.getCostumeIndexByName = function (costumeName) {
|
|||
Clone.prototype.updateAllDrawableProperties = function () {
|
||||
if (this.renderer) {
|
||||
var renderedDirectionScale = this._getRenderedDirectionAndScale();
|
||||
var costume = this.sprite.costumes[this.currentCostume];
|
||||
this.renderer.updateDrawableProperties(this.drawableID, {
|
||||
position: [this.x, this.y],
|
||||
direction: renderedDirectionScale.direction,
|
||||
scale: renderedDirectionScale.scale,
|
||||
visible: this.visible,
|
||||
skin: this.sprite.costumes[this.currentCostume].skin
|
||||
skin: costume.skin,
|
||||
costumeResolution: costume.bitmapResolution,
|
||||
rotationCenter: [costume.rotationCenterX, costume.rotationCenterY]
|
||||
});
|
||||
if (this.visible) {
|
||||
this.runtime.requestRedraw();
|
||||
|
|
Loading…
Reference in a new issue