diff --git a/packages/avatar/src/AvatarImage.ts b/packages/avatar/src/AvatarImage.ts index efbe64e6..c85abb8a 100644 --- a/packages/avatar/src/AvatarImage.ts +++ b/packages/avatar/src/AvatarImage.ts @@ -221,7 +221,8 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener point.x += avatarCanvas.regPoint.x; point.y += avatarCanvas.regPoint.y; - partContainer.position.set(point.x, point.y); + partContainer.x = Math.floor(point.x); + partContainer.y = Math.floor(point.y); container.addChild(partContainer); } @@ -282,8 +283,6 @@ export class AvatarImage implements IAvatarImage, IAvatarEffectListener if(!this._activeTexture) return null; - this._activeTexture.source.scaleMode = 'nearest'; - const container = this.buildAvatarContainer(avatarCanvas, setType); GetRenderer().render({ diff --git a/packages/room/src/object/visualization/furniture/FurnitureGuildIsometricBadgeVisualization.ts b/packages/room/src/object/visualization/furniture/FurnitureGuildIsometricBadgeVisualization.ts index 57403bdf..930dff20 100644 --- a/packages/room/src/object/visualization/furniture/FurnitureGuildIsometricBadgeVisualization.ts +++ b/packages/room/src/object/visualization/furniture/FurnitureGuildIsometricBadgeVisualization.ts @@ -73,7 +73,8 @@ export class FurnitureGuildIsometricBadgeVisualization extends IsometricImageFur sprite.setFromMatrix(matrix); - sprite.position.set(0); + sprite.x = 0; + sprite.y = 0; return TextureUtils.generateTexture(sprite); diff --git a/packages/room/src/object/visualization/furniture/FurnitureVisualizationData.ts b/packages/room/src/object/visualization/furniture/FurnitureVisualizationData.ts index f58d6bdc..e1e64ed2 100644 --- a/packages/room/src/object/visualization/furniture/FurnitureVisualizationData.ts +++ b/packages/room/src/object/visualization/furniture/FurnitureVisualizationData.ts @@ -1,5 +1,6 @@ import { IAssetData, IAssetVisualizationData, IObjectVisualizationData } from '@nitrots/api'; import { BLEND_MODES } from 'pixi.js'; +import { RoomGeometry } from '../../../utils'; import { ColorData, LayerData, SizeData } from '../data'; export class FurnitureVisualizationData implements IObjectVisualizationData @@ -105,11 +106,33 @@ export class FurnitureVisualizationData implements IObjectVisualizationData this._sizes.push(size); } + this.removeInvalidSizes(); + this._sizes.sort(); return true; } + private removeInvalidSizes(): void + { + if(!this._sizes || !this._sizes.length) return; + + const zoomedIn = this._sizeDatas.get(RoomGeometry.SCALE_ZOOMED_IN); + const zoomedOut = this._sizeDatas.get(RoomGeometry.SCALE_ZOOMED_OUT); + + if(zoomedIn && zoomedOut) + { + if(zoomedIn.layerCount !== zoomedOut.layerCount) + { + this._sizeDatas.delete(RoomGeometry.SCALE_ZOOMED_OUT); + + const index = this._sizes.indexOf(RoomGeometry.SCALE_ZOOMED_OUT); + + if(index >= 0) this._sizes.splice(index, 1); + } + } + } + protected processVisualElement(sizeData: SizeData, key: string, data: any): boolean { if(!sizeData || !key || !data) return false; diff --git a/packages/room/src/object/visualization/furniture/IsometricImageFurniVisualization.ts b/packages/room/src/object/visualization/furniture/IsometricImageFurniVisualization.ts index 2504825b..45641894 100644 --- a/packages/room/src/object/visualization/furniture/IsometricImageFurniVisualization.ts +++ b/packages/room/src/object/visualization/furniture/IsometricImageFurniVisualization.ts @@ -105,7 +105,8 @@ export class IsometricImageFurniVisualization extends FurnitureAnimatedVisualiza const offsetX = ((background.width - sprite.width) / 2); const offsetY = ((background.height - sprite.height) / 2); - sprite.position.set(offsetX, offsetY); + sprite.x = Math.floor(offsetX); + sprite.y = Math.floor(offsetY); container.addChild(background, sprite); diff --git a/packages/room/src/renderer/RoomSpriteCanvas.ts b/packages/room/src/renderer/RoomSpriteCanvas.ts index 4e55ac8f..5786f24b 100644 --- a/packages/room/src/renderer/RoomSpriteCanvas.ts +++ b/packages/room/src/renderer/RoomSpriteCanvas.ts @@ -266,7 +266,8 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas if((this._display.x !== this._screenOffsetX) || (this._display.y !== this._screenOffsetY)) { - this._display.position.set(this._screenOffsetX, this._screenOffsetY); + this._display.x = Math.floor(this._screenOffsetX); + this._display.y = Math.floor(this._screenOffsetY); update = true; } @@ -562,8 +563,8 @@ export class RoomSpriteCanvas implements IRoomRenderingCanvas this.updateEnterRoomEffect(extendedSprite, objectSprite); } - if(extendedSprite.x !== sprite.x) extendedSprite.x = sprite.x; - if(extendedSprite.y !== sprite.y) extendedSprite.y = sprite.y; + extendedSprite.x = Math.round(sprite.x); + extendedSprite.y = Math.round(sprite.y); extendedSprite.offsetX = objectSprite.offsetX; extendedSprite.offsetY = objectSprite.offsetY;