mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 13:50:43 +00:00
Revert "fix: resolve drawImage scaling penalty on non-square sprite height (#3320)"
This reverts commit 17f32a590c.
This commit is contained in:
@@ -290,15 +290,14 @@ export class UnitLayer implements Layer {
|
||||
.filter((unitView) => isSpriteReady(unitView))
|
||||
.forEach((unitView) => {
|
||||
const sprite = getColoredSprite(unitView, this.theme);
|
||||
const clearsize = sprite.width + 1;
|
||||
const lastX = this.game.x(unitView.lastTile());
|
||||
const lastY = this.game.y(unitView.lastTile());
|
||||
const clearX = Math.round(lastX - sprite.width / 2);
|
||||
const clearY = Math.round(lastY - sprite.height / 2);
|
||||
this.context.clearRect(
|
||||
clearX - 1,
|
||||
clearY - 1,
|
||||
sprite.width + 2,
|
||||
sprite.height + 2,
|
||||
lastX - clearsize / 2,
|
||||
lastY - clearsize / 2,
|
||||
clearsize,
|
||||
clearsize,
|
||||
);
|
||||
});
|
||||
}
|
||||
@@ -612,7 +611,7 @@ export class UnitLayer implements Layer {
|
||||
Math.round(x - sprite.width / 2),
|
||||
Math.round(y - sprite.height / 2),
|
||||
sprite.width,
|
||||
sprite.height,
|
||||
sprite.width,
|
||||
);
|
||||
if (!targetable) {
|
||||
this.context.restore();
|
||||
|
||||
Reference in New Issue
Block a user