Skip to content

Commit

Permalink
ちらつき防止 ToDo:Firefox対応
Browse files Browse the repository at this point in the history
  • Loading branch information
Nanasu committed Feb 1, 2024
1 parent 20450df commit 9f78af2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/app/component/game-table/game-table.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<img style="visibility: hidden; pointer-events: none; position: absolute" [src]="backgroundImageUrl | safe: 'resourceUrl'" (load)="isBackgroundImageLoaded = true">
<img style="visibility: hidden; pointer-events: none; position: absolute" [src]="backgroundImageUrl2 | safe: 'resourceUrl'">
<img style="visibility: hidden; pointer-events: none; position: absolute" [src]="backgroundImageUrl2 | safe: 'resourceUrl'" (load)="isBackgroundImageLoaded2 = true">
<div class="background-image is-pointer-events-none" [ngClass]="[(backgroundFilterType ? 'is-filter' : ''), (isStealthMode && !isGMMode ? 'is-hide-in' : ''), backgroundFilterType]"
[style.background-image]="backgroundImageCss | safe: 'style'"></div>
<div class="component is-fill is-perspective" [ngClass]="{'is-grabbing': isPointerDragging}" #root>
Expand Down
11 changes: 9 additions & 2 deletions src/app/component/game-table/game-table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export class GameTableComponent implements OnInit, OnDestroy, AfterViewInit {
private _currentBackgroundImage2 :ImageFile;
private _currentBackgroundImageUrl2: string = '';
isBackgroundImageLoaded = false;
isBackgroundImageLoaded2 = false;
get tableImageUrls(): string[] {
let revokeTableImageUrl = '';
let revokeBackgroundImageUrl = '';
Expand All @@ -113,9 +114,9 @@ export class GameTableComponent implements OnInit, OnDestroy, AfterViewInit {
}
if (isFlash || this._currentBackgroundImage?.identifier != this.backgroundImage.identifier) {
this._currentBackgroundImage = this.backgroundImage;
this.isBackgroundImageLoaded = false;
if (this.backgroundImage.state === ImageState.COMPLETE) {
if (this._currentBackgroundImageUrl) revokeBackgroundImageUrl = this._currentBackgroundImageUrl;
this.isBackgroundImageLoaded = false;
this._currentBackgroundImageUrl = URL.createObjectURL(this.backgroundImage.blob);
} else {
this._currentBackgroundImageUrl = this.backgroundImage.url;
Expand All @@ -125,6 +126,7 @@ export class GameTableComponent implements OnInit, OnDestroy, AfterViewInit {
this._currentBackgroundImage2 = this.backgroundImage2;
if (this.backgroundImage2.state === ImageState.COMPLETE) {
if (this._currentBackgroundImageUrl2) revokeBackgroundImageUrl2 = this._currentBackgroundImageUrl2;
this.isBackgroundImageLoaded2 = false;
this._currentBackgroundImageUrl2 = URL.createObjectURL(this.backgroundImage2.blob);
} else {
this._currentBackgroundImageUrl2 = this.backgroundImage2.url;
Expand All @@ -143,12 +145,17 @@ export class GameTableComponent implements OnInit, OnDestroy, AfterViewInit {
get tableImageUrl(): string { return this.tableImageUrls[0]; }
get backgroundImageUrl(): string { return this.tableImageUrls[1]; }
get backgroundImageUrl2(): string { return this.tableImageUrls[2]; }

private _currentBackgroundImageCss = '';
get backgroundImageCss(): string {
if (this._currentBackgroundImageCss && ((this.backgroundImageUrl && !this.isBackgroundImageLoaded) || (this.backgroundImageUrl2 && !this.isBackgroundImageLoaded2))) return this._currentBackgroundImageCss;
let ret: string[] = [];
if (this.backgroundImageUrl) ret.push(`url(${this.backgroundImageUrl})`);
if (this.backgroundImageUrl2 && (!this.backgroundImageUrl || (this.backgroundImageUrl && this.isBackgroundImageLoaded))) ret.push(`url(${this.backgroundImageUrl2})`);
return ret.join(',');
this._currentBackgroundImageCss = ret.join(',');
return this._currentBackgroundImageCss;
}

constructor(
private ngZone: NgZone,
private contextMenuService: ContextMenuService,
Expand Down
2 changes: 1 addition & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="google" content="notranslate">
<title>Udonarium with Fly 1.9.3b (Powered by Udonarium 1.16.0)</title>
<title>Udonarium with Fly 1.9.3d (Powered by Udonarium 1.16.0)</title>
<base href="./">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="mobile-web-app-capable" content="yes">
Expand Down

0 comments on commit 9f78af2

Please sign in to comment.