Skip to content

Commit

Permalink
Merge pull request #157 from Next2D/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ienaga authored Nov 6, 2023
2 parents bc52af7 + aa6eac5 commit d5ae681
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 82 deletions.
65 changes: 33 additions & 32 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ name: "CodeQL"

on:
push:
branches: [ main, develop ]
branches: [ "main", "develop" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main, develop ]
branches: [ "main", "develop" ]
schedule:
- cron: '38 23 * * 1'
- cron: '44 22 * * 5'

jobs:
analyze:
Expand All @@ -32,40 +32,41 @@ jobs:
strategy:
fail-fast: false
matrix:
language: [ 'javascript' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
language: [ 'javascript-typescript' ]
# CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ]
# Use only 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release
#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
2 changes: 1 addition & 1 deletion next2d.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@next2d/player",
"version": "1.18.7",
"version": "1.18.8",
"description": "Experience the fast and beautiful anti-aliased rendering of WebGL. You can create rich, interactive graphics, cross-platform applications and games without worrying about browser or device compatibility.",
"author": "Toshiyuki Ienaga<[email protected]> (https://github.com/ienaga/)",
"license": "MIT",
Expand Down
6 changes: 3 additions & 3 deletions packages/events/src/Event.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ export class Event
* @const
* @static
*/
static get OPEN ()
static get OPEN (): string
{
return "open";
}
Expand Down Expand Up @@ -645,7 +645,7 @@ export class Event
* @method
* @public
*/
stopImmediatePropagation ()
stopImmediatePropagation (): void
{
this._$stopImmediatePropagation = true;
}
Expand All @@ -660,7 +660,7 @@ export class Event
* @method
* @public
*/
stopPropagation ()
stopPropagation (): void
{
this._$stopPropagation = true;
}
Expand Down
74 changes: 30 additions & 44 deletions packages/ui/src/Job.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,22 +277,19 @@ export class Job extends EventDispatcher
this._$stopFlag = false;
this._$startTime = $performance.now();

this._$names = this.entries(this._$from);
this._$names = this._$entries(this._$from);

// add event
this.addEventListener(Event.ENTER_FRAME, (event: Event) =>
{
this._$update(event);
});
// start
this._$update();
}

/**
* @param {object} object
* @return {array}
* @method
* @public
* @private
*/
entries (object: any): any[]
_$entries (object: any): any[]
{
const entries: any[] = Object.entries(object);

Expand All @@ -302,42 +299,31 @@ export class Job extends EventDispatcher

const value: any = values[1];
if (value && typeof value === "object") {
values[1] = this.entries(value);
values[1] = this._$entries(value);
}
}

return entries;
}

/**
* @return {Promise}
* @return {void}
* @method
* @public
*/
start (): Promise<void>
start (): void
{
return new Promise((resolve): void =>
{
if (!this.hasEventListener(Event.COMPLETE)) {
this.addEventListener(Event.COMPLETE, (event: Event) =>
{
this.removeEventListener(Event.COMPLETE, event.listener);
resolve();
});
}
if (this._$delay) {

if (this._$delay) {
$setTimeout((): void =>
{
this.initialize();
}, this._$delay * 1000);

$setTimeout(() =>
{
this.initialize();
}, this._$delay * 1000);

return ;
}
return ;
}

this.initialize();
});
this.initialize();
}

/**
Expand All @@ -349,10 +335,7 @@ export class Job extends EventDispatcher
{
if (this.hasEventListener(Event.STOP)) {
this.dispatchEvent(new Event(Event.STOP));
}

if (this.hasEventListener(Event.ENTER_FRAME)) {
this.removeAllEventListener(Event.ENTER_FRAME);
this.removeAllEventListener(Event.STOP);
}

if (this.hasEventListener(Event.UPDATE)) {
Expand All @@ -368,36 +351,39 @@ export class Job extends EventDispatcher
}

/**
* @param {Event} event
* @return {void}
* @method
* @private
*/
_$update (event: Event): void
_$update (): void
{
if (this._$stopFlag) {
return ;
}

if (!this._$names) {
return this.stop();
}

// update current time
this._$currentTime = ($performance.now() - this._$startTime) * 0.001;

if (this._$names) {
this._$updateProperty(
this._$target, this._$from, this._$to, this._$names
);
}
this._$updateProperty(
this._$target, this._$from, this._$to, this._$names
);

if (this.hasEventListener(Event.UPDATE)) {
this.dispatchEvent(new Event(Event.UPDATE));
}

if (this._$currentTime >= this._$duration) {

this.removeEventListener(Event.ENTER_FRAME, event.listener);

if (this.hasEventListener(Event.COMPLETE)) {
this.dispatchEvent(new Event(Event.COMPLETE));
}
} else {
requestAnimationFrame(() => {
this._$update();
});
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Next2D } from "@next2d/core";

if (!("next2d" in window)) {

console.log("%c Next2D Player %c 1.18.7 %c https://next2d.app",
console.log("%c Next2D Player %c 1.18.8 %c https://next2d.app",
"color: #fff; background: #5f5f5f",
"color: #fff; background: #4bc729",
"");
Expand Down

0 comments on commit d5ae681

Please sign in to comment.