X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTWidget.java;h=4450e52fbe97c094bbbf554021536024f878903f;hb=49befbbc7844658943c919ba0654da3d2bc91303;hp=4dfe5a14a890e3b4415232ab75d2d035ab20ded3;hpb=2ce6dab2bbd951e6d0f09f94759efda5ee4b65ac;p=fanfix.git diff --git a/src/jexer/TWidget.java b/src/jexer/TWidget.java index 4dfe5a1..4450e52 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);