From 28408004e116078a657b518daff67faaf8c78230 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Wed, 13 Nov 2024 08:32:55 -0800 Subject: [PATCH 01/17] actions: try with Lime 8.2.1 --- .github/workflows/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 055d1354ec..254510e960 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: haxelib install hxcpp --quiet haxelib install format --quiet haxelib install hxp --quiet - haxelib install lime 8.1.3 --quiet + haxelib install lime --quiet haxelib install utest --quiet - name: Setup environment run: | @@ -56,7 +56,7 @@ jobs: haxelib install hxcpp --quiet haxelib install format --quiet haxelib install hxp --quiet - haxelib install lime 8.1.3 --quiet + haxelib install lime --quiet haxelib install utest --quiet - name: Setup environment @@ -98,7 +98,7 @@ jobs: haxelib install hxcpp --quiet haxelib install format --quiet haxelib install hxp --quiet - haxelib install lime 8.1.3 --quiet + haxelib install lime --quiet haxelib install utest --quiet - name: Setup environment From c93b5005a69f78f16caab14ffd10ce5ba896bdef Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Wed, 13 Nov 2024 08:42:19 -0800 Subject: [PATCH 02/17] actions: HashLink tests with Haxe 4.3.6 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 254510e960..e371b7d2ce 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -76,7 +76,7 @@ jobs: strategy: matrix: # Lime doesn't support Haxe 3 with HashLink - haxe-version: [4.0.5, 4.1.5, 4.2.5] + haxe-version: [4.0.5, 4.1.5, 4.2.5, 4.3.6] # AL init fails on both windows and ubuntu # macos-14 is arm64, which setup-haxe doesn't support yet runs-on: macos-13 From 76a9d3d3513508a4893dee7888d55d5ecddc663b Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Wed, 13 Nov 2024 08:44:00 -0800 Subject: [PATCH 03/17] actions: Neko unit tests for Haxe 3 now use Lime tools like all other versions The hxp tests don't set up Application.current, which breaks ThreadPool. The hxp tests were always a pain to maintain anyway, so good riddance, in my opinion. --- .github/workflows/main.yml | 34 ++-------------------------------- 1 file changed, 2 insertions(+), 32 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e371b7d2ce..9b6c8574f2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,40 +3,10 @@ on: [push, pull_request] jobs: - unit-test-neko-haxe3: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: true - - uses: krdlab/setup-haxe@v1 - with: - haxe-version: 3.4.7 - - name: Set HAXEPATH - run: | - echo "HAXEPATH=$HAXE_STD_PATH/.." >> $GITHUB_ENV - - name: Install Haxe dependencies - run: | - haxelib install hxcpp --quiet - haxelib install format --quiet - haxelib install hxp --quiet - haxelib install lime --quiet - haxelib install utest --quiet - - name: Setup environment - run: | - haxelib dev openfl ${{ github.workspace }} - - name: Install command aliases - run: | - haxelib run lime setup -alias -y - haxelib run openfl setup -alias -y - - name: Run tests on Neko - run: | - haxelib run hxp test -Dtarget=neko -verbose --install-hxp-alias - unit-test-neko: strategy: matrix: - haxe-version: [4.0.5, 4.1.5, 4.2.5, 4.3.6] + haxe-version: [3.4.7, 4.0.5, 4.1.5, 4.2.5, 4.3.6] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -496,7 +466,7 @@ jobs: notify: runs-on: ubuntu-latest - needs: [package-haxelib, docs, unit-test-neko-haxe3, unit-test-neko, unit-test-hashlink, unit-test-air, html5-samples, flash-samples, neko-samples, hashlink-samples] + needs: [package-haxelib, docs, unit-test-neko, unit-test-hashlink, unit-test-air, html5-samples, flash-samples, neko-samples, hashlink-samples] if: ${{ github.repository == 'openfl/openfl' && github.event_name != 'pull_request' }} steps: - name: Notify Discord From d863321aa09c380f59d0001835843a62ff0fef04 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Wed, 13 Nov 2024 08:53:52 -0800 Subject: [PATCH 04/17] actions: use krdlab/setup-haxe@master because v1 is not ideal for macOS anymore --- .github/workflows/main.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9b6c8574f2..c7a977640b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: with: submodules: true - - uses: krdlab/setup-haxe@v1 + - uses: krdlab/setup-haxe@master with: haxe-version: ${{ matrix.haxe-version }} @@ -55,7 +55,7 @@ jobs: with: submodules: true - - uses: krdlab/setup-haxe@v1 + - uses: krdlab/setup-haxe@master with: haxe-version: ${{ matrix.haxe-version }} @@ -161,7 +161,7 @@ jobs: with: submodules: true - - uses: krdlab/setup-haxe@v1 + - uses: krdlab/setup-haxe@master with: haxe-version: ${{ matrix.haxe-version }} @@ -204,7 +204,7 @@ jobs: with: submodules: true - - uses: krdlab/setup-haxe@v1 + - uses: krdlab/setup-haxe@master with: haxe-version: 4.2.5 @@ -240,7 +240,7 @@ jobs: with: submodules: true - - uses: krdlab/setup-haxe@v1 + - uses: krdlab/setup-haxe@master with: haxe-version: 4.2.5 @@ -276,7 +276,7 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: krdlab/setup-haxe@v1 + - uses: krdlab/setup-haxe@master with: haxe-version: ${{ matrix.haxe-version }} @@ -322,7 +322,7 @@ jobs: runs-on: windows-latest steps: - - uses: krdlab/setup-haxe@v1 + - uses: krdlab/setup-haxe@master with: haxe-version: 4.1.5 @@ -377,7 +377,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: krdlab/setup-haxe@v1 + - uses: krdlab/setup-haxe@master with: haxe-version: 4.2.5 @@ -423,7 +423,7 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: krdlab/setup-haxe@v1 + - uses: krdlab/setup-haxe@master with: haxe-version: 4.2.5 From 75d3b7a9a8faf88fbed6fc6e4bb99a9182958931 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Wed, 13 Nov 2024 08:57:23 -0800 Subject: [PATCH 05/17] Revert "actions: use krdlab/setup-haxe@master because v1 is not ideal for macOS anymore" This reverts commit d863321aa09c380f59d0001835843a62ff0fef04. --- .github/workflows/main.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c7a977640b..9b6c8574f2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,7 +13,7 @@ jobs: with: submodules: true - - uses: krdlab/setup-haxe@master + - uses: krdlab/setup-haxe@v1 with: haxe-version: ${{ matrix.haxe-version }} @@ -55,7 +55,7 @@ jobs: with: submodules: true - - uses: krdlab/setup-haxe@master + - uses: krdlab/setup-haxe@v1 with: haxe-version: ${{ matrix.haxe-version }} @@ -161,7 +161,7 @@ jobs: with: submodules: true - - uses: krdlab/setup-haxe@master + - uses: krdlab/setup-haxe@v1 with: haxe-version: ${{ matrix.haxe-version }} @@ -204,7 +204,7 @@ jobs: with: submodules: true - - uses: krdlab/setup-haxe@master + - uses: krdlab/setup-haxe@v1 with: haxe-version: 4.2.5 @@ -240,7 +240,7 @@ jobs: with: submodules: true - - uses: krdlab/setup-haxe@master + - uses: krdlab/setup-haxe@v1 with: haxe-version: 4.2.5 @@ -276,7 +276,7 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: krdlab/setup-haxe@master + - uses: krdlab/setup-haxe@v1 with: haxe-version: ${{ matrix.haxe-version }} @@ -322,7 +322,7 @@ jobs: runs-on: windows-latest steps: - - uses: krdlab/setup-haxe@master + - uses: krdlab/setup-haxe@v1 with: haxe-version: 4.1.5 @@ -377,7 +377,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: krdlab/setup-haxe@master + - uses: krdlab/setup-haxe@v1 with: haxe-version: 4.2.5 @@ -423,7 +423,7 @@ jobs: runs-on: ubuntu-20.04 steps: - - uses: krdlab/setup-haxe@master + - uses: krdlab/setup-haxe@v1 with: haxe-version: 4.2.5 From c2d56b5e61d45bf4682bc58754d177606e5912d3 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Wed, 13 Nov 2024 08:57:34 -0800 Subject: [PATCH 06/17] Revert "actions: HashLink tests with Haxe 4.3.6" This reverts commit c93b5005a69f78f16caab14ffd10ce5ba896bdef. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9b6c8574f2..1150195a01 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,7 +46,7 @@ jobs: strategy: matrix: # Lime doesn't support Haxe 3 with HashLink - haxe-version: [4.0.5, 4.1.5, 4.2.5, 4.3.6] + haxe-version: [4.0.5, 4.1.5, 4.2.5] # AL init fails on both windows and ubuntu # macos-14 is arm64, which setup-haxe doesn't support yet runs-on: macos-13 From 8fbc2f60b2723f8d053349b2803545845b32e470 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Wed, 13 Nov 2024 09:29:31 -0800 Subject: [PATCH 07/17] actions: neko unit tests still seem to fail on Lime 8.2.1 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1150195a01..09fb8e116e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,7 +26,7 @@ jobs: haxelib install hxcpp --quiet haxelib install format --quiet haxelib install hxp --quiet - haxelib install lime --quiet + haxelib install lime 8.1.3 --quiet haxelib install utest --quiet - name: Setup environment From 86d931a5344769d52475c8e24bd84de333844080 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Wed, 13 Nov 2024 09:33:52 -0800 Subject: [PATCH 08/17] Revert "actions: Neko unit tests for Haxe 3 now use Lime tools like all other versions" This reverts commit 76a9d3d3513508a4893dee7888d55d5ecddc663b. --- .github/workflows/main.yml | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 09fb8e116e..b54a308e31 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -3,10 +3,40 @@ on: [push, pull_request] jobs: + unit-test-neko-haxe3: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: true + - uses: krdlab/setup-haxe@v1 + with: + haxe-version: 3.4.7 + - name: Set HAXEPATH + run: | + echo "HAXEPATH=$HAXE_STD_PATH/.." >> $GITHUB_ENV + - name: Install Haxe dependencies + run: | + haxelib install hxcpp --quiet + haxelib install format --quiet + haxelib install hxp --quiet + haxelib install lime --quiet + haxelib install utest --quiet + - name: Setup environment + run: | + haxelib dev openfl ${{ github.workspace }} + - name: Install command aliases + run: | + haxelib run lime setup -alias -y + haxelib run openfl setup -alias -y + - name: Run tests on Neko + run: | + haxelib run hxp test -Dtarget=neko -verbose --install-hxp-alias + unit-test-neko: strategy: matrix: - haxe-version: [3.4.7, 4.0.5, 4.1.5, 4.2.5, 4.3.6] + haxe-version: [4.0.5, 4.1.5, 4.2.5, 4.3.6] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -466,7 +496,7 @@ jobs: notify: runs-on: ubuntu-latest - needs: [package-haxelib, docs, unit-test-neko, unit-test-hashlink, unit-test-air, html5-samples, flash-samples, neko-samples, hashlink-samples] + needs: [package-haxelib, docs, unit-test-neko-haxe3, unit-test-neko, unit-test-hashlink, unit-test-air, html5-samples, flash-samples, neko-samples, hashlink-samples] if: ${{ github.repository == 'openfl/openfl' && github.event_name != 'pull_request' }} steps: - name: Notify Discord From d7ce90197d299a1fb54c411e24c41460518163cc Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Wed, 13 Nov 2024 09:35:06 -0800 Subject: [PATCH 09/17] actions: separate Haxe 3 Neko tests again because we're back to Lime 8.1.3 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b54a308e31..74b981b050 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: haxelib install hxcpp --quiet haxelib install format --quiet haxelib install hxp --quiet - haxelib install lime --quiet + haxelib install lime 8.1.3 --quiet haxelib install utest --quiet - name: Setup environment run: | From 57591babe048d830d3c1961bc29a381595d298fe Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Mon, 18 Nov 2024 09:45:35 -0800 Subject: [PATCH 10/17] docs formatting fixes --- src/openfl/display/BitmapData.hx | 26 +++++++++++++------------- src/openfl/display/Graphics.hx | 24 ++++++++++++------------ src/openfl/display/GraphicsStroke.hx | 19 +++++++++---------- src/openfl/display/MovieClip.hx | 2 +- src/openfl/media/Sound.hx | 4 +--- src/openfl/media/SoundLoaderContext.hx | 4 +--- src/openfl/media/SoundMixer.hx | 4 +--- src/openfl/net/FileReference.hx | 8 ++------ src/openfl/net/NetConnection.hx | 3 +-- src/openfl/net/NetStream.hx | 16 ++++++---------- src/openfl/net/SharedObject.hx | 25 ++++++++++++------------- src/openfl/net/Socket.hx | 11 +++-------- src/openfl/net/URLStream.hx | 4 +--- src/openfl/net/XMLSocket.hx | 7 ++----- src/openfl/system/Security.hx | 20 +++++--------------- 15 files changed, 70 insertions(+), 107 deletions(-) diff --git a/src/openfl/display/BitmapData.hx b/src/openfl/display/BitmapData.hx index c1785f4277..41d38c0b4d 100644 --- a/src/openfl/display/BitmapData.hx +++ b/src/openfl/display/BitmapData.hx @@ -112,6 +112,10 @@ import openfl.display._internal.stats.DrawCallContext; @see `openfl.display.Graphics.beginBitmapFill()` @see `openfl.display.Graphics.lineBitmapStyle()` **/ +#if !openfl_debug +@:fileXml('tags="haxe,release"') +@:noDebug +#end @:access(lime.graphics.opengl.GL) @:access(lime.graphics.Image) @:access(lime.graphics.ImageBuffer) @@ -127,10 +131,6 @@ import openfl.display._internal.stats.DrawCallContext; @:access(openfl.geom.Matrix) @:access(openfl.geom.Point) @:access(openfl.geom.Rectangle) -#if !openfl_debug -@:fileXml('tags="haxe,release"') -@:noDebug -#end @:autoBuild(openfl.utils._internal.AssetsMacro.embedBitmap()) class BitmapData implements IBitmapDrawable { @@ -619,16 +619,16 @@ class BitmapData implements IBitmapDrawable the new channel data is placed. To copy only channel data from one area to a different area in the destination image, specify a point other than - (0,0). + (0,0). @param sourceChannel The source channel. Use a value from the BitmapDataChannel class - (`BitmapDataChannel.RED`, + (`BitmapDataChannel.RED`, `BitmapDataChannel.BLUE`, `BitmapDataChannel.GREEN`, `BitmapDataChannel.ALPHA`). @param destChannel The destination channel. Use a value from the BitmapDataChannel class - (`BitmapDataChannel.RED`, + (`BitmapDataChannel.RED`, `BitmapDataChannel.BLUE`, `BitmapDataChannel.GREEN`, `BitmapDataChannel.ALPHA`). @@ -2570,10 +2570,10 @@ class BitmapData implements IBitmapDrawable } /** - When targeting AIR, this method locks an image so that any objects - that reference the BitmapData object, such as Bitmap objects, are not - updated when this BitmapData object changes. To improve performance, - use this method along with the `unlock()` method before and after numerous + When targeting AIR, this method locks an image so that any objects + that reference the BitmapData object, such as Bitmap objects, are not + updated when this BitmapData object changes. To improve performance, + use this method along with the `unlock()` method before and after numerous calls to the `setPixel()` or `setPixel32()` method. Note: This method only provides an optimization on the AIR(Flash) target. @@ -3072,8 +3072,8 @@ class BitmapData implements IBitmapDrawable } /** - When targeting AIR, this method Unlocks an image so that any objects that reference - the BitmapData object, such as Bitmap objects, are updated when this BitmapData object + When targeting AIR, this method Unlocks an image so that any objects that reference + the BitmapData object, such as Bitmap objects, are updated when this BitmapData object changes. To improve performance, use this method along with the `lock()` diff --git a/src/openfl/display/Graphics.hx b/src/openfl/display/Graphics.hx index de829f1141..3b672af84e 100644 --- a/src/openfl/display/Graphics.hx +++ b/src/openfl/display/Graphics.hx @@ -140,10 +140,10 @@ import js.html.CanvasRenderingContext2D; example, you can use the following matrix to rotate a bitmap by 45 degrees(pi/4 radians): - ```haxe - matrix = new openfl.geom.Matrix(); - matrix.rotate(Math.PI / 4); - ``` + ```haxe + matrix = new openfl.geom.Matrix(); + matrix.rotate(Math.PI / 4); + ``` @param repeat If `true`, the bitmap image repeats in a tiled pattern. If `false`, the bitmap image does not @@ -605,7 +605,7 @@ import js.html.CanvasRenderingContext2D; /** Draws an ellipse. Set the line style, fill, or both before you call the `drawEllipse()` method, by calling the - `linestyle()`, `lineGradientStyle()`, + `lineStyle()`, `lineGradientStyle()`, `beginFill()`, `beginGradientFill()`, or `beginBitmapFill()` method. @@ -943,7 +943,7 @@ import js.html.CanvasRenderingContext2D; /** Draws a rectangle. Set the line style, fill, or both before you call the - `drawRect()` method, by calling the `linestyle()`, + `drawRect()` method, by calling the `lineStyle()`, `lineGradientStyle()`, `beginFill()`, `beginGradientFill()`, or `beginBitmapFill()` method. @@ -956,7 +956,7 @@ import js.html.CanvasRenderingContext2D; @param height The height of the rectangle (in pixels). @throws ArgumentError If the `width` or `height` parameters are not a number - (`Number.NaN`). + (`Number.NaN`). @see [Drawing shapes using built-in methods](https://books.openfl.org/openfl-developers-guide/using-the-drawing-api/drawing-shapes-using-built-in-methods.html) **/ @@ -978,7 +978,7 @@ import js.html.CanvasRenderingContext2D; /** Draws a rounded rectangle. Set the line style, fill, or both before you call the `drawRoundRect()` method, by calling the - `linestyle()`, `lineGradientStyle()`, + `lineStyle()`, `lineGradientStyle()`, `beginFill()`, `beginGradientFill()`, or `beginBitmapFill()` method. @@ -987,7 +987,7 @@ import js.html.CanvasRenderingContext2D; object(in pixels). @param y A number indicating the vertical position relative to the registration point of the parent display object - (in pixels). + (in pixels). @param width The width of the round rectangle (in pixels). @param height The height of the round rectangle (in pixels). @param ellipseWidth The width of the ellipse used to draw the rounded @@ -1341,7 +1341,7 @@ import js.html.CanvasRenderingContext2D; @param color A hexadecimal color value of the line; for example, red is 0xFF0000, blue is 0x0000FF, and so on. If a value is not indicated, the default is 0x000000 - (black). Optional. + (black). Optional. @param alpha A number that indicates the alpha value of the color of the line; valid values are 0 to 1. If a value is not indicated, the default is 1 (solid). If the value @@ -1360,7 +1360,7 @@ import js.html.CanvasRenderingContext2D; rectangles that are identical, except that the `pixelHinting` parameter used in the `lineStyle()` method is set differently - (the images are scaled by 200%, to emphasize the + (the images are scaled by 200%, to emphasize the difference): ![pixelHinting false and pixelHinting true](/images/lineStyle_pixelHinting.jpg) @@ -1373,7 +1373,7 @@ import js.html.CanvasRenderingContext2D; * `LineScaleMode.NORMAL` - Always scale the line thickness when the object is scaled - (the default). + (the default). * `LineScaleMode.NONE` - Never scale the line thickness. * `LineScaleMode.VERTICAL` - Do not diff --git a/src/openfl/display/GraphicsStroke.hx b/src/openfl/display/GraphicsStroke.hx index 972302b0f0..64c0aa7856 100644 --- a/src/openfl/display/GraphicsStroke.hx +++ b/src/openfl/display/GraphicsStroke.hx @@ -99,24 +99,23 @@ import openfl.display._internal.GraphicsDataType; /** Specifies the stroke thickness scaling. Valid values are: - * `LineScaleMode.NORMAL` - Always scale the line thickness + * `LineScaleMode.NORMAL` - Always scale the line thickness when the object is scaled (the default). - * `LineScaleMode.NONE` - Never scale the line thickness. + * `LineScaleMode.NONE` - Never scale the line thickness. - * `LineScaleMode.VERTICAL` - Do not scale the line + * `LineScaleMode.VERTICAL` - Do not scale the line thickness if the object is scaled vertically _only_. For example, consider the following circles, drawn with a one-pixel line, and each with the `scaleMode` parameter set to `LineScaleMode.VERTICAL`. The circle on the left is scaled vertically only, and the circle on the right is scaled both vertically and horizontally: - * `LineScaleMode.HORIZONTAL` - Do not scale the line + * `LineScaleMode.HORIZONTAL` - Do not scale the line thickness if the object is scaled horizontally _only_. For example, consider the following circles, drawn with a one-pixel line, and each with - the `scaleMode` parameter set to - `LineScaleMode.HORIZONTAL`. The circle on the left is scaled - horizontally only, and the circle on the right is scaled both vertically - and horizontally: + the `scaleMode` parameter set to `LineScaleMode.HORIZONTAL`. The circle + on the left is scaled horizontally only, and the circle on the right is + scaled both vertically and horizontally: **/ public var scaleMode:LineScaleMode; @@ -147,7 +146,7 @@ import openfl.display._internal.GraphicsDataType; rounded rectangles that are identical, except that the `pixelHinting` parameter used in the `lineStyle()` method is set differently - (the images are scaled by 200%, to emphasize the + (the images are scaled by 200%, to emphasize the difference): If a value is not supplied, the line does not use @@ -157,7 +156,7 @@ import openfl.display._internal.GraphicsDataType; * `LineScaleMode.NORMAL` - Always scale the line thickness when the object is scaled - (the default). + (the default). * `LineScaleMode.NONE` - Never scale the line thickness. * `LineScaleMode.VERTICAL` - Do not diff --git a/src/openfl/display/MovieClip.hx b/src/openfl/display/MovieClip.hx index 1a98abe62f..5f970a7834 100644 --- a/src/openfl/display/MovieClip.hx +++ b/src/openfl/display/MovieClip.hx @@ -32,7 +32,7 @@ import openfl.events.MouseEvent; stop the playhead in any child MovieClip objects of that MovieClip object. - **Note:**Flash Lite 4 supports the MovieClip.opaqueBackground + **Note:** Flash Lite 4 supports the MovieClip.opaqueBackground property only if FEATURE_BITMAPCACHE is defined. The default configuration of Flash Lite 4 does not define FEATURE_BITMAPCACHE. To enable the MovieClip.opaqueBackground property for a suitable device, define diff --git a/src/openfl/media/Sound.hx b/src/openfl/media/Sound.hx index 69a861f422..a88178788f 100644 --- a/src/openfl/media/Sound.hx +++ b/src/openfl/media/Sound.hx @@ -196,9 +196,7 @@ class Sound extends EventDispatcher these security limitations. For more information related to security, see the Flash Player - Developer Center Topic: Security. + Developer Center Topic: [Security](http://www.adobe.com/go/devnet_security_en). **/ public var id3(get, never):ID3Info; diff --git a/src/openfl/media/SoundLoaderContext.hx b/src/openfl/media/SoundLoaderContext.hx index 5d7a47f980..619c1bff12 100644 --- a/src/openfl/media/SoundLoaderContext.hx +++ b/src/openfl/media/SoundLoaderContext.hx @@ -129,9 +129,7 @@ class SoundLoaderContext content, regardless of its origin. For more information related to security, see the Flash Player - Developer Center Topic: Security. + Developer Center Topic: [Security](http://www.adobe.com/go/devnet_security_en). **/ public var checkPolicyFile:Bool; diff --git a/src/openfl/media/SoundMixer.hx b/src/openfl/media/SoundMixer.hx index 1a8eeba2f6..945d5774ad 100644 --- a/src/openfl/media/SoundMixer.hx +++ b/src/openfl/media/SoundMixer.hx @@ -163,9 +163,7 @@ package openfl.media; these security limitations. For more information related to security, see the Flash Player - Developer Center Topic: Security. + Developer Center Topic: [Security](http://www.adobe.com/go/devnet_security_en). **/ public static function stopAll():Void diff --git a/src/openfl/net/FileReference.hx b/src/openfl/net/FileReference.hx index aa11ef40dc..bb98d99c4a 100644 --- a/src/openfl/net/FileReference.hx +++ b/src/openfl/net/FileReference.hx @@ -722,9 +722,7 @@ class FileReference extends EventDispatcher these security limitations. For more information related to security, see the Flash Player - Developer Center Topic: Security. + Developer Center Topic: [Security](http://www.adobe.com/go/devnet_security_en). When you download a file using this method, it is flagged as downloaded on operating systems that flag downloaded files: @@ -1200,9 +1198,7 @@ class FileReference extends EventDispatcher these security limitations. For more information related to security, see the Flash Player - Developer Center Topic: Security. + Developer Center Topic: [Security](http://www.adobe.com/go/devnet_security_en). Note that because of new functionality added to the Flash Player, when publishing to Flash Player 10, you can have only one of the following diff --git a/src/openfl/net/NetConnection.hx b/src/openfl/net/NetConnection.hx index e7912b922f..ea8e869a3b 100644 --- a/src/openfl/net/NetConnection.hx +++ b/src/openfl/net/NetConnection.hx @@ -448,8 +448,7 @@ class NetConnection extends EventDispatcher these security limitations. For more information about security, see the Adobe Flash Player - Developer Center: Security. + Developer Center: [Security](http://www.adobe.com/go/devnet_security_en). @param command Use one of the following values for the `command` parameter: diff --git a/src/openfl/net/NetStream.hx b/src/openfl/net/NetStream.hx index 07286eeb94..b611bcb9e7 100644 --- a/src/openfl/net/NetStream.hx +++ b/src/openfl/net/NetStream.hx @@ -25,7 +25,7 @@ import js.Browser; * Call `NetStream.appendBytes()` to pass ByteArray data into the NetStream. - **Note:**You cannot play and publish a stream over the same NetStream + **Note:** You cannot play and publish a stream over the same NetStream object. Adobe AIR and Flash Player 9.0.115.0 and later versions support files @@ -509,8 +509,7 @@ import js.Browser; **/ @:access(openfl.media.SoundMixer) #if !openfl_debug -@:fileXml('tags="haxe,release"') -@:noDebug +@:fileXml('tags="haxe,release"') @:noDebug #end class NetStream extends EventDispatcher { @@ -781,9 +780,7 @@ class NetStream extends EventDispatcher For more information on policy files, see "Website controls (policy files)" in the _OpenFL Developer's Guide_ and the Flash - Player Developer Center Topic: Security. + Player Developer Center Topic: [Security](http://www.adobe.com/go/devnet_security_en). **/ public var checkPolicyFile:Bool; @@ -1553,7 +1550,7 @@ class NetStream extends EventDispatcher To play a recorded file, pass the file name. 6. Call `addChild()` and pass the Video object to display the video. - **Note:**To see sample code, scroll to the example at the bottom of + **Note:** To see sample code, scroll to the example at the bottom of this page. **Enable Data Generation Mode** @@ -1580,8 +1577,7 @@ class NetStream extends EventDispatcher setting the `allowNetworking` parameter of the the `object` and `embed` tags in the HTML page that contains the SWF content. For more information related to security, see the Flash Player Developer Center - Topic: Security. + Topic: [Security](http://www.adobe.com/go/devnet_security_en). @throws ArgumentError At least one parameter must be specified. @throws Error The NetStream Object is invalid. This may be due @@ -1676,7 +1672,7 @@ class NetStream extends EventDispatcher href="http://www.adobe.com/go/fms_tools" scope="external">www.adobe.com/go/fms_tools. - **Note:**Do not use this method to play a stream. To play a stream, + **Note:** Do not use this method to play a stream. To play a stream, call the `NetStream.play()` method. Workflow for publishing a stream diff --git a/src/openfl/net/SharedObject.hx b/src/openfl/net/SharedObject.hx index 33e7248236..a59047a5ac 100644 --- a/src/openfl/net/SharedObject.hx +++ b/src/openfl/net/SharedObject.hx @@ -430,16 +430,16 @@ class SharedObject extends EventDispatcher allotted for this object. @return Either of the following values: - * `SharedObjectFlushStatus.PENDING`: The user has - permitted local information storage for objects from this domain, - but the amount of space allotted is not sufficient to store the - object. Flash Player prompts the user to allow more space. To - allow space for the shared object to grow when it is saved, thus - avoiding a `SharedObjectFlushStatus.PENDING` return - value, pass a value for `minDiskSpace`. - * `SharedObjectFlushStatus.FLUSHED`: The shared - object has been successfully written to a file on the local - disk. + * `SharedObjectFlushStatus.PENDING`: The user has permitted + local information storage for objects from this domain, but the + amount of space allotted is not sufficient to store the object. + Flash Player prompts the user to allow more space. To allow + space for the shared object to grow when it is saved, thus + avoiding a `SharedObjectFlushStatus.PENDING` return + value, pass a value for `minDiskSpace`. + + * `SharedObjectFlushStatus.FLUSHED`: The shared object has been + successfully written to a file on the local disk. @throws Error Flash Player cannot write the shared object to disk. This error might occur if the user has permanently disallowed @@ -848,9 +848,8 @@ class SharedObject extends EventDispatcher the server that the value of the property has changed. The `setProperty()` method explicitly marks properties as changed, or dirty. - For more information about remote shared objects see the Flash Media Server - documentation. + For more information about remote shared objects see the + [Flash Media Server documentation](http://www.adobe.com/go/learn_fms_docs_en). **Note:** The `SharedObject.setProperty()` method implements the `setDirty()` method. In most cases, such as when the value of a diff --git a/src/openfl/net/Socket.hx b/src/openfl/net/Socket.hx index 97a41aa8c8..5df67ef4ee 100644 --- a/src/openfl/net/Socket.hx +++ b/src/openfl/net/Socket.hx @@ -95,8 +95,7 @@ import sys.net.Socket as SysSocket; application security sandbox. For more information related to security, see the Flash Player Developer - Center Topic: Security + Center Topic: [Security](http://www.adobe.com/go/devnet_security_en).s @event close Dispatched when the server closes the socket connection. @@ -287,9 +286,7 @@ class Socket extends EventDispatcher implements IDataInput implements IDataOutpu more information on policy files, see "Website controls (policy files)" in the _OpenFL Developer's Guide_ and the Flash Player Developer - Center Topic: Security. + Center Topic: [Security](http://www.adobe.com/go/devnet_security_en). **/ public function new(host:String = null, port:Int = 0) { @@ -370,9 +367,7 @@ class Socket extends EventDispatcher implements IDataInput implements IDataOutpu more information on policy files, see "Website controls (policy files)" in the _OpenFL Developer's Guide_ and the Flash Player Developer - Center Topic: Security. + Center Topic: [Security](http://www.adobe.com/go/devnet_security_en). **/ public function connect(host:String, port:Int):Void { diff --git a/src/openfl/net/URLStream.hx b/src/openfl/net/URLStream.hx index c3acbb7576..5cae4ec368 100644 --- a/src/openfl/net/URLStream.hx +++ b/src/openfl/net/URLStream.hx @@ -194,9 +194,7 @@ class URLStream extends EventDispatcher implements IDataInput security limitations. For more information related to security, see The Flash Player - Developer Center Topic: Security. + Developer Center Topic: [Security](http://www.adobe.com/go/devnet_security_en). In AIR, a URLRequest object can register for the `httpResponse` status event. Unlike the `httpStatus` event, the `httpResponseStatus` event diff --git a/src/openfl/net/XMLSocket.hx b/src/openfl/net/XMLSocket.hx index 737c321412..b8492fd47e 100644 --- a/src/openfl/net/XMLSocket.hx +++ b/src/openfl/net/XMLSocket.hx @@ -66,8 +66,7 @@ import openfl.utils.ByteArray; security limitations. For more information related to security, see the Flash Player Developer - Center Topic: Security. + Center Topic: [Security](http://www.adobe.com/go/devnet_security_en). @event close Dispatched when the server closes the socket connection. The `close` event is dispatched only when @@ -179,9 +178,7 @@ class XMLSocket extends EventDispatcher `allowNetworking` parameter of the the `object` and `embed` tags in the HTML page that contains the SWF content. - For more information, see the Flash Player Developer Center Topic: Security. + For more information, see the Flash Player Developer Center Topic: [Security](http://www.adobe.com/go/devnet_security_en). @param host A fully qualified DNS domain name or an IP address in the form _111.222.333.444_. You can also specify `null` to diff --git a/src/openfl/system/Security.hx b/src/openfl/system/Security.hx index 70cbff0f15..4410ff304b 100644 --- a/src/openfl/system/Security.hx +++ b/src/openfl/system/Security.hx @@ -135,9 +135,7 @@ class Security content and data from any domain. For more information related to security, see the Flash Player - Developer Center Topic: Security. + Developer Center Topic: [Security](http://www.adobe.com/go/devnet_security_en). **/ public static var sandboxType(default, null):String; @@ -311,9 +309,7 @@ class Security It is usually safer to use the `_url` property. For more information related to security, see the Flash Player - Developer Center Topic: Security. + Developer Center Topic: [Security](http://www.adobe.com/go/devnet_security_en). @throws SecurityError Calling this method from code in the AIR application security sandbox throws a @@ -362,9 +358,7 @@ class Security with security architecture and should be used for background information only. The Flash Player Developer Center contains extensive information on Flash Player and security. For more information, see - the Flash Player Developer Center Topic Security. + the Flash Player Developer Center Topic: [Security](http://www.adobe.com/go/devnet_security_en). Suppose you are building an e-commerce site that consists of two components: a catalog, which does not need to be secure, because it @@ -464,9 +458,7 @@ class Security sure to consider the consequences carefully before doing so. For more information related to security, see the Flash Player - Developer Center Topic: Security. + Developer Center Topic: [Security](http://www.adobe.com/go/devnet_security_en). @throws SecurityError Calling this method from code in the AIR application security sandbox causes a @@ -567,9 +559,7 @@ class Security HTML page that contains the SWF content. For more information related to security, see the Flash Player - Developer Center Topic: Security. + Developer Center Topic: [Security](http://www.adobe.com/go/devnet_security_en). @param url The URL location of the policy file to be loaded. **/ From fb629c553f711502e4c2218b8acee8fb51776128 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Tue, 19 Nov 2024 09:13:00 -0800 Subject: [PATCH 11/17] CanvasGraphics: restore old code for SpreadMethod.PAD because the change in #2658 broke certain gradients Some gradients were not rendering correctly in Chrome or Safari (but worked in Firefox, interestingly) with OpenFL 9.4, but worked fine in OpenFL 9.3. Keeping the new SpreadMethod implementations the same, though. They might have a similar issue, but I'm not familiar enough with how they work to test to see if it reproduces. Relevant community thread where issue was reported: https://community.openfl.org/t/issues-after-upgrading-to-openfl-9-4-0-lime-8-2-0/14026 --- .../display/_internal/CanvasGraphics.hx | 39 ++++++++++++++----- 1 file changed, 29 insertions(+), 10 deletions(-) diff --git a/src/openfl/display/_internal/CanvasGraphics.hx b/src/openfl/display/_internal/CanvasGraphics.hx index da91375fed..8d15fcd65c 100644 --- a/src/openfl/display/_internal/CanvasGraphics.hx +++ b/src/openfl/display/_internal/CanvasGraphics.hx @@ -142,19 +142,21 @@ class CanvasGraphics gradientFill.addColorStop(ratio, getRGBA(colors[i], alphas[i])); } - case LINEAR: - var gradientScale:Float = spreadMethod == PAD ? 1.0 : 25.0; - var dx = 0.5 * (gradientScale - 1.0) * 1638.4; - var canvas:CanvasElement = cast Browser.document.createElement("canvas"); - var context2 = canvas.getContext("2d"); + if (point != null) Point.__pool.release(point); + if (point2 != null) Point.__pool.release(point2); + if (releaseMatrix) Matrix.__pool.release(matrix); - var dimensions:Dynamic = getDimensions(matrix); + return cast(gradientFill); - canvas.width = context.canvas.width; - canvas.height = context.canvas.height; - gradientFill = context.createLinearGradient(-819.2 - dx, 0, 819.2 + dx, 0); + case LINEAR: if (spreadMethod == PAD) { + gradientFill = context.createLinearGradient(-819.2, 0, 819.2, 0); + + pendingMatrix = matrix.clone(); + inversePendingMatrix = matrix.clone(); + inversePendingMatrix.invert(); + for (i in 0...colors.length) { ratio = ratios[i] / 0xFF; @@ -163,8 +165,25 @@ class CanvasGraphics gradientFill.addColorStop(ratio, getRGBA(colors[i], alphas[i])); } + + if (point != null) Point.__pool.release(point); + if (point2 != null) Point.__pool.release(point2); + if (releaseMatrix) Matrix.__pool.release(matrix); + + return cast(gradientFill); } - else if (spreadMethod == REFLECT) + + var gradientScale:Float = spreadMethod == PAD ? 1.0 : 25.0; + var dx = 0.5 * (gradientScale - 1.0) * 1638.4; + var canvas:CanvasElement = cast Browser.document.createElement("canvas"); + var context2 = canvas.getContext("2d"); + + var dimensions:Dynamic = getDimensions(matrix); + + canvas.width = context.canvas.width; + canvas.height = context.canvas.height; + gradientFill = context.createLinearGradient(-819.2 - dx, 0, 819.2 + dx, 0); + if (spreadMethod == REFLECT) { var t:Float = 0; var step:Float = 1 / 25; From 581e32f5bdb1c228592d4ffb453685d1e72030a9 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Tue, 19 Nov 2024 09:28:57 -0800 Subject: [PATCH 12/17] tests: longer timeouts for new-ish file tests --- tests/filesystem/src/FileStreamTest.hx | 2 +- tests/filesystem/src/FileTest.hx | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tests/filesystem/src/FileStreamTest.hx b/tests/filesystem/src/FileStreamTest.hx index 0c5c662ed8..81dd6b8528 100644 --- a/tests/filesystem/src/FileStreamTest.hx +++ b/tests/filesystem/src/FileStreamTest.hx @@ -73,7 +73,7 @@ class FileStreamTest extends Test Assert.equals("this is a text file", contentsRead); } - @:timeout(1000) + @:timeout(2000) public function test_readText_async(async:Async) { var file = assetsDirectory.resolvePath("asset.txt"); diff --git a/tests/filesystem/src/FileTest.hx b/tests/filesystem/src/FileTest.hx index 7c87cd8b54..6bbc25e6fa 100644 --- a/tests/filesystem/src/FileTest.hx +++ b/tests/filesystem/src/FileTest.hx @@ -151,7 +151,7 @@ class FileTest extends Test Assert.isFalse(directoryToDelete.isDirectory); } - @:timeout(1000) + @:timeout(2000) public function test_deleteDirectoryAsync(async:Async) { var directoryToDelete = writableDirectory.resolvePath("deleteDirectoryAsync-test"); @@ -189,7 +189,7 @@ class FileTest extends Test Assert.isFalse(fileToDelete.exists); } - @:timeout(1000) + @:timeout(2000) public function test_deleteFileAsync(async:Async) { var sourceFile = assetsDirectory.resolvePath("asset.txt"); @@ -223,7 +223,7 @@ class FileTest extends Test Assert.notNull(assetFile); } - @:timeout(1000) + @:timeout(2000) public function test_getDirectoryListingAsync(async:Async) { Assert.isTrue(assetsDirectory.exists); @@ -267,7 +267,7 @@ class FileTest extends Test Assert.equals("this is a text file", contentsRead); } - @:timeout(1000) + @:timeout(2000) public function test_copyToAsync(async:Async) { var sourceFile = assetsDirectory.resolvePath("asset.txt"); @@ -321,7 +321,7 @@ class FileTest extends Test Assert.equals(contents, contentsRead); } - @:timeout(1000) + @:timeout(2000) public function test_moveToAsync(async:Async) { var sourceFile = writableDirectory.resolvePath("sourceFile.txt"); From 9ae92d01f3ca33b5b4e7c781ab1e90344821b73e Mon Sep 17 00:00:00 2001 From: Joseph Cloutier Date: Thu, 3 Oct 2024 20:46:52 -0400 Subject: [PATCH 13/17] Make `curveTo()` and `cubicCurveTo()` update drawing position. --- src/openfl/display/_internal/CairoGraphics.hx | 6 ++++++ src/openfl/display/_internal/CanvasGraphics.hx | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/src/openfl/display/_internal/CairoGraphics.hx b/src/openfl/display/_internal/CairoGraphics.hx index 2cea6f5289..acded99ef9 100644 --- a/src/openfl/display/_internal/CairoGraphics.hx +++ b/src/openfl/display/_internal/CairoGraphics.hx @@ -533,11 +533,17 @@ class CairoGraphics c.anchorY - offsetY); + positionX = c.anchorX; + positionY = c.anchorY; + case CURVE_TO: var c = data.readCurveTo(); hasPath = true; quadraticCurveTo(c.controlX - offsetX, c.controlY - offsetY, c.anchorX - offsetX, c.anchorY - offsetY); + positionX = c.anchorX; + positionY = c.anchorY; + case DRAW_CIRCLE: var c = data.readDrawCircle(); hasPath = true; diff --git a/src/openfl/display/_internal/CanvasGraphics.hx b/src/openfl/display/_internal/CanvasGraphics.hx index 8d15fcd65c..ef24314c12 100644 --- a/src/openfl/display/_internal/CanvasGraphics.hx +++ b/src/openfl/display/_internal/CanvasGraphics.hx @@ -705,11 +705,17 @@ class CanvasGraphics c.anchorY - offsetY); + positionX = c.anchorX; + positionY = c.anchorY; + case CURVE_TO: var c = data.readCurveTo(); hasPath = true; context.quadraticCurveTo(c.controlX - offsetX, c.controlY - offsetY, c.anchorX - offsetX, c.anchorY - offsetY); + positionX = c.anchorX; + positionY = c.anchorY; + case DRAW_CIRCLE: var c = data.readDrawCircle(); hasPath = true; From e1d19b502dd6c6f9ad3b17f350bc6d23492e4778 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Tue, 19 Nov 2024 11:51:53 -0800 Subject: [PATCH 14/17] BitmapDataFileIOTest: increase timeout on async test because it fails intermittently and was using the default timeout of 250ms --- tests/bitmapdata/src/BitmapDataFileIOTest.hx | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/bitmapdata/src/BitmapDataFileIOTest.hx b/tests/bitmapdata/src/BitmapDataFileIOTest.hx index 83cb7c4794..dd04d0a918 100644 --- a/tests/bitmapdata/src/BitmapDataFileIOTest.hx +++ b/tests/bitmapdata/src/BitmapDataFileIOTest.hx @@ -12,6 +12,7 @@ class BitmapDataFileIOTest extends Test #if flash @Ignored #end + @:timeout(1000) public function test_BitmapData_fromBase64(async:Async) { ByteArray.loadFromFile("openfl-base64.txt").onComplete(function(logoBytes) From 12718d48b4eddb9b3a5c517239937c609a5cff62 Mon Sep 17 00:00:00 2001 From: Josh Tynjala Date: Tue, 19 Nov 2024 11:54:45 -0800 Subject: [PATCH 15/17] CairoGraphics, CanvasGraphics: minor optimization of two ifs to if/elseif --- src/openfl/display/_internal/CairoGraphics.hx | 2 +- src/openfl/display/_internal/CanvasGraphics.hx | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/openfl/display/_internal/CairoGraphics.hx b/src/openfl/display/_internal/CairoGraphics.hx index acded99ef9..754ec5c06d 100644 --- a/src/openfl/display/_internal/CairoGraphics.hx +++ b/src/openfl/display/_internal/CairoGraphics.hx @@ -136,7 +136,7 @@ class CairoGraphics ratio = ratios[i] / 0xFF; if (ratio < 0) ratio = 0; - if (ratio > 1) ratio = 1; + else if (ratio > 1) ratio = 1; pattern.addColorStopRGBA(ratio, r, g, b, alpha); } diff --git a/src/openfl/display/_internal/CanvasGraphics.hx b/src/openfl/display/_internal/CanvasGraphics.hx index ef24314c12..e54a458be8 100644 --- a/src/openfl/display/_internal/CanvasGraphics.hx +++ b/src/openfl/display/_internal/CanvasGraphics.hx @@ -137,7 +137,7 @@ class CanvasGraphics { ratio = ratios[i] / 0xFF; if (ratio < 0) ratio = 0; - if (ratio > 1) ratio = 1; + else if (ratio > 1) ratio = 1; gradientFill.addColorStop(ratio, getRGBA(colors[i], alphas[i])); } @@ -161,7 +161,7 @@ class CanvasGraphics { ratio = ratios[i] / 0xFF; if (ratio < 0) ratio = 0; - if (ratio > 1) ratio = 1; + else if (ratio > 1) ratio = 1; gradientFill.addColorStop(ratio, getRGBA(colors[i], alphas[i])); } @@ -195,7 +195,7 @@ class CanvasGraphics ratio = ratios[i] / 0xFF; ratio = t + ratio * step; if (ratio < 0) ratio = 0; - if (ratio > 1) ratio = 1; + else if (ratio > 1) ratio = 1; gradientFill.addColorStop(ratio, getRGBA(colors[i], alphas[i])); } @@ -206,7 +206,7 @@ class CanvasGraphics ratio = ratios[a] / 0xFF; ratio = t + (1.0 - ratio) * step; if (ratio < 0) ratio = 0; - if (ratio > 1) ratio = 1; + else if (ratio > 1) ratio = 1; gradientFill.addColorStop(ratio, getRGBA(colors[a], alphas[a])); a--; } @@ -225,14 +225,14 @@ class CanvasGraphics ratio = ratios[i] / 0xFF; ratio = t + ratio * step; if (ratio < 0) ratio = 0; - if (ratio > 1) ratio = 1 - 0.001; + else if (ratio > 1) ratio = 1 - 0.001; gradientFill.addColorStop(ratio, getRGBA(colors[i], alphas[i])); } ratio = t + 0.001; if (ratio < 0) ratio = 0; - if (ratio > 1) ratio = 1; + else if (ratio > 1) ratio = 1; gradientFill.addColorStop(ratio - 0.001, getRGBA(colors[colors.length - 1], alphas[alphas.length - 1])); gradientFill.addColorStop(ratio, getRGBA(colors[0], alphas[0])); From b21b1d0a3e26cd72096a364f48ac225a61c7d9e3 Mon Sep 17 00:00:00 2001 From: Rainy <939029835@qq.com> Date: Wed, 20 Nov 2024 06:40:47 +0800 Subject: [PATCH 16/17] OpenGLRenderer: Fix incorrect caused by Math.ceil and Math.floor in __scissorRect at extreme zoom levels. (#2705) * Delete Math.ceil and Math.floor for __ scissorRect. In cases where the browser scaling ratio is very large, using Math.floor or Math.ceil will result in significant pixel errors, so it needs to be removed. * Add uv offest. * OpenGLRenderer: prefer ffloor() and fceil() over adding :Float type to variables --------- Co-authored-by: Josh Tynjala --- src/openfl/display/OpenGLRenderer.hx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/openfl/display/OpenGLRenderer.hx b/src/openfl/display/OpenGLRenderer.hx index b5356bdd1c..0944075956 100644 --- a/src/openfl/display/OpenGLRenderer.hx +++ b/src/openfl/display/OpenGLRenderer.hx @@ -991,17 +991,18 @@ class OpenGLRenderer extends DisplayObjectRenderer { if (clipRect != null) { - var x = Math.floor(clipRect.x); - var y = Math.floor(clipRect.y); - var width = (clipRect.width > 0 ? Math.ceil(clipRect.right) - x : 0); - var height = (clipRect.height > 0 ? Math.ceil(clipRect.bottom) - y : 0); + var x = Math.ffloor(clipRect.x); + var y = Math.ffloor(clipRect.y); + var width = (clipRect.width > 0 ? Math.fceil(clipRect.right) - x : 0); + var height = (clipRect.height > 0 ? Math.fceil(clipRect.bottom) - y : 0); #if !openfl_dpi_aware if (__context3D.__backBufferWantsBestResolution) { - x = Math.floor(clipRect.x / __pixelRatio); - y = Math.floor(clipRect.y / __pixelRatio); - width = (clipRect.width > 0 ? Math.ceil(clipRect.right / __pixelRatio) - x : 0); - height = (clipRect.height > 0 ? Math.ceil(clipRect.bottom / __pixelRatio) - y : 0); + var uv = 1.5 / __pixelRatio; + x = clipRect.x / __pixelRatio; + y = clipRect.y / __pixelRatio; + width = (clipRect.width > 0 ? (clipRect.right / __pixelRatio) - x + uv : 0); + height = (clipRect.height > 0 ? (clipRect.bottom / __pixelRatio) - y + uv : 0); } #end From a85b04d0f40df6046850ca37c26cf522846f3110 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Y=C4=B1ld=C4=B1r=C4=B1m?= <25794892+barisyild@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:35:56 +0300 Subject: [PATCH 17/17] Tracy profiler support added --- src/openfl/display/Stage.hx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/openfl/display/Stage.hx b/src/openfl/display/Stage.hx index 9fcb872139..b14eefbe28 100644 --- a/src/openfl/display/Stage.hx +++ b/src/openfl/display/Stage.hx @@ -2162,7 +2162,11 @@ class Stage extends DisplayObjectContainer #if lime implements IModule #end Telemetry.__endTiming(TelemetryCommandName.RENDER); Telemetry.__rewindStack(stack); #end - + + #if HXCPP_TRACY + cpp.vm.tracy.TracyProfiler.frameMark(); + #end + return cancelled; }