public override Element hit(Vector2 point) { var hit = base.hit(point); if (hit == null || hit == this) { return(hit); } if (point.Y >= 0 && point.Y <= getPadTop() && point.X >= 0 && point.X <= width) { // Hit the title bar, don't use the hit child if it is in the Window's table. Element current = hit; while (current.getParent() != this) { current = current.getParent(); } if (getCell(current) != null) { return(this); } } return(hit); }
public override Element hit(Vector2 point) { // TODO: is this correct? should we be transforming the point here? if (!hasParent()) { point = stageToLocalCoordinates(point); } var hit = base.hit(point); if (hit == null || hit == this) { return(hit); } var height = getHeight(); if (y <= height && y >= height - getPadTop() && x >= 0 && x <= getWidth()) { // Hit the title bar, don't use the hit child if it is in the Window's table. Element current = hit; while (current.getParent() != this) { current = current.getParent(); } if (getCell(current) != null) { return(this); } } return(hit); }