Skip to content

Commit

Permalink
Sprite: check if new stage is not equal to old stage when determining…
Browse files Browse the repository at this point in the history
… if stopDrag() should be called

Originally, there was no check, then I checked if the new stage was null, but actually, it should be if the new stage is not the same as the current stage.

Followup to b9c96fd
  • Loading branch information
joshtynjala committed Jun 5, 2024
1 parent 2c368ca commit 7da4de5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/openfl/display/Sprite.hx
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class Sprite extends DisplayObjectContainer

@:noCompletion private override function __setStageReference(stage:Stage):Void
{
if (stage == null && this.stage != null && this.stage.__dragObject == this)
if (this.stage != stage && this.stage != null && this.stage.__dragObject == this)
{
stopDrag();
}
Expand Down

0 comments on commit 7da4de5

Please sign in to comment.