Skip to content

Commit

Permalink
Pointer: don't cancel selections on interaction with debugger UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Gama11 committed Mar 15, 2017
1 parent e038e34 commit 897f21f
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions flixel/system/debug/interaction/Interaction.hx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package flixel.system.debug.interaction;
import flash.display.BitmapData;
import flash.display.Graphics;
import flash.display.Sprite;
import flash.display.DisplayObject;
import flash.events.KeyboardEvent;
import flixel.FlxObject;
import flash.events.MouseEvent;
Expand Down Expand Up @@ -126,9 +127,9 @@ class Interaction extends Window

private function handleMouseClick(event:MouseEvent):Void
{
// Did the user click a debugger icon instead of performing
// Did the user click a debugger UI element instead of performing
// a click related to a tool?
if (Std.is(event.target, FlxSystemButton))
if (event.type == MouseEvent.MOUSE_DOWN && belongsToDebugger(event.target))
return;

pointerJustPressed = event.type == MouseEvent.MOUSE_DOWN;
Expand All @@ -139,6 +140,15 @@ class Interaction extends Window
else if (pointerJustReleased)
pointerPressed = false;
}

private function belongsToDebugger(object:DisplayObject):Bool
{
if (object == null)
return false;
else if (Std.is(object, FlxDebugger))
return true;
return belongsToDebugger(object.parent);
}

private function handleMouseInDebugger(event:MouseEvent):Void
{
Expand Down

0 comments on commit 897f21f

Please sign in to comment.