X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjexer%2FTWidget.java;h=d4ec1e2ba9ae8cfc23fb5eaac9d03915125d880b;hb=227d6f00ab1e02efd71ac7437ade8b9beb5792d6;hp=4dfe5a14a890e3b4415232ab75d2d035ab20ded3;hpb=2ce6dab2bbd951e6d0f09f94759efda5ee4b65ac;p=fanfix.git diff --git a/src/jexer/TWidget.java b/src/jexer/TWidget.java index 4dfe5a1..d4ec1e2 100644 --- a/src/jexer/TWidget.java +++ b/src/jexer/TWidget.java @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (C) 2016 Kevin Lamonte + * Copyright (C) 2017 Kevin Lamonte * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -868,7 +868,8 @@ public abstract class TWidget implements Comparable { */ public void onMouseDown(final TMouseEvent mouse) { // Default: do nothing, pass to children instead - for (TWidget widget: children) { + for (int i = children.size() - 1 ; i >= 0 ; i--) { + TWidget widget = children.get(i); if (widget.mouseWouldHit(mouse)) { // Dispatch to this child, also activate it activate(widget); @@ -889,7 +890,8 @@ public abstract class TWidget implements Comparable { */ public void onMouseUp(final TMouseEvent mouse) { // Default: do nothing, pass to children instead - for (TWidget widget: children) { + for (int i = children.size() - 1 ; i >= 0 ; i--) { + TWidget widget = children.get(i); if (widget.mouseWouldHit(mouse)) { // Dispatch to this child, also activate it activate(widget);