mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 12:00:44 +00:00
fix(NameLayer): apply opacity to flags rendering
- Added context save and restore around flag rendering to apply a global alpha of 0.8, ensuring flags are rendered with the correct opacity as per legacy behavior.
This commit is contained in:
@@ -457,6 +457,8 @@ export class NameLayer implements Layer {
|
||||
}
|
||||
|
||||
if (hasFlag) {
|
||||
ctx.save();
|
||||
ctx.globalAlpha *= 0.8;
|
||||
this.drawImage(
|
||||
ctx,
|
||||
`/flags/${flag}.svg`,
|
||||
@@ -465,6 +467,7 @@ export class NameLayer implements Layer {
|
||||
flagW,
|
||||
flagH,
|
||||
);
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
ctx.fillText(cache.lastName, nameLeftX + flagW, nameCenterY);
|
||||
|
||||
Reference in New Issue
Block a user