Skip to content

Commit

Permalink
DisplayObjectContainer: More haxe ver compat
Browse files Browse the repository at this point in the history
Minor fixes for haxe version compat
  • Loading branch information
dimensionscape committed Jul 10, 2024
1 parent c4e8e4f commit 5d276b1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/starling/display/DisplayObjectContainer.hx
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ class DisplayObjectContainer extends DisplayObject {

// If the container is on the stage, dispatch the ADDED_TO_STAGE event
if (stage != null) {
var container:DisplayObjectContainer = Std.isOfType(child, DisplayObjectContainer) ? cast child : null;
var container:DisplayObjectContainer = #if (haxe_ver < 4.2) Std.is #else Std.isOfType #end(child, DisplayObjectContainer) ? cast child : null;
if (container != null) {
container.broadcastEventWith(Event.ADDED_TO_STAGE);
} else {
Expand Down Expand Up @@ -209,7 +209,7 @@ class DisplayObjectContainer extends DisplayObject {

// If the child is on the stage, dispatch the REMOVED_FROM_STAGE event
if (stage != null) {
var container:DisplayObjectContainer = Std.isOfType(child, DisplayObjectContainer) ? cast child : null;
var container:DisplayObjectContainer = #if (haxe_ver < 4.2) Std.is #else Std.isOfType #end(child, DisplayObjectContainer) ? cast child : null;
if (container != null) {
container.broadcastEventWith(Event.REMOVED_FROM_STAGE);
} else {
Expand Down Expand Up @@ -662,7 +662,7 @@ class DisplayObjectContainer extends DisplayObject {
listeners[listeners.length] = object; // avoiding 'push'
}

var container:DisplayObjectContainer = Std.isOfType(object, DisplayObjectContainer) ? cast object : null;
var container:DisplayObjectContainer = #if (haxe_ver < 4.2) Std.is #else Std.isOfType #end(object, DisplayObjectContainer) ? cast object : null;

if (container != null) {
var children:Array<DisplayObject> = container.__children;
Expand Down

0 comments on commit 5d276b1

Please sign in to comment.