mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-01-11 10:39:56 -05:00
Fix bitmap support. In Scratch 3.0, we are defaulting to bitmapResolution = 2 for all costumes.
This commit is contained in:
parent
e1d9df3b1b
commit
af7ed61016
2 changed files with 4 additions and 4 deletions
|
@ -69,8 +69,8 @@ const loadCostumeFromAsset = function (costume, costumeAsset, runtime) {
|
||||||
|
|
||||||
if (!rotationCenter) {
|
if (!rotationCenter) {
|
||||||
rotationCenter = renderer.getSkinRotationCenter(costume.skinId);
|
rotationCenter = renderer.getSkinRotationCenter(costume.skinId);
|
||||||
costume.rotationCenterX = rotationCenter[0];
|
costume.rotationCenterX = rotationCenter[0] * 2;
|
||||||
costume.rotationCenterY = rotationCenter[1];
|
costume.rotationCenterY = rotationCenter[1] * 2;
|
||||||
}
|
}
|
||||||
return costume;
|
return costume;
|
||||||
});
|
});
|
||||||
|
|
|
@ -438,7 +438,7 @@ class RenderedTarget extends Target {
|
||||||
typeof costume.rotationCenterX !== 'undefined' &&
|
typeof costume.rotationCenterX !== 'undefined' &&
|
||||||
typeof costume.rotationCenterY !== 'undefined'
|
typeof costume.rotationCenterY !== 'undefined'
|
||||||
) {
|
) {
|
||||||
const scale = costume.bitmapResolution || 1;
|
const scale = costume.bitmapResolution || 2;
|
||||||
drawableProperties.rotationCenter = [
|
drawableProperties.rotationCenter = [
|
||||||
costume.rotationCenterX / scale,
|
costume.rotationCenterX / scale,
|
||||||
costume.rotationCenterY / scale
|
costume.rotationCenterY / scale
|
||||||
|
@ -625,7 +625,7 @@ class RenderedTarget extends Target {
|
||||||
if (this.renderer) {
|
if (this.renderer) {
|
||||||
const renderedDirectionScale = this._getRenderedDirectionAndScale();
|
const renderedDirectionScale = this._getRenderedDirectionAndScale();
|
||||||
const costume = this.getCostumes()[this.currentCostume];
|
const costume = this.getCostumes()[this.currentCostume];
|
||||||
const bitmapResolution = costume.bitmapResolution || 1;
|
const bitmapResolution = costume.bitmapResolution || 2;
|
||||||
const props = {
|
const props = {
|
||||||
position: [this.x, this.y],
|
position: [this.x, this.y],
|
||||||
direction: renderedDirectionScale.direction,
|
direction: renderedDirectionScale.direction,
|
||||||
|
|
Loading…
Reference in a new issue