Fix bitmap support. In Scratch 3.0, we are defaulting to bitmapResolution = 2 for all costumes.

This commit is contained in:
Karishma Chadha 2018-04-22 21:22:03 -04:00
parent e1d9df3b1b
commit af7ed61016
2 changed files with 4 additions and 4 deletions

View file

@ -69,8 +69,8 @@ const loadCostumeFromAsset = function (costume, costumeAsset, runtime) {
if (!rotationCenter) {
rotationCenter = renderer.getSkinRotationCenter(costume.skinId);
costume.rotationCenterX = rotationCenter[0];
costume.rotationCenterY = rotationCenter[1];
costume.rotationCenterX = rotationCenter[0] * 2;
costume.rotationCenterY = rotationCenter[1] * 2;
}
return costume;
});

View file

@ -438,7 +438,7 @@ class RenderedTarget extends Target {
typeof costume.rotationCenterX !== 'undefined' &&
typeof costume.rotationCenterY !== 'undefined'
) {
const scale = costume.bitmapResolution || 1;
const scale = costume.bitmapResolution || 2;
drawableProperties.rotationCenter = [
costume.rotationCenterX / scale,
costume.rotationCenterY / scale
@ -625,7 +625,7 @@ class RenderedTarget extends Target {
if (this.renderer) {
const renderedDirectionScale = this._getRenderedDirectionAndScale();
const costume = this.getCostumes()[this.currentCostume];
const bitmapResolution = costume.bitmapResolution || 1;
const bitmapResolution = costume.bitmapResolution || 2;
const props = {
position: [this.x, this.y],
direction: renderedDirectionScale.direction,