Skip to content

Commit

Permalink
Merge pull request #10616 from Cattlesquat/GuadDammit
Browse files Browse the repository at this point in the history
10616 Mouseover Stack Viewer was failing to launch in certain situations
  • Loading branch information
uckelman authored Oct 25, 2021
2 parents 790d96a + 8d78413 commit 92014d1
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,14 @@ public Filter() {
topLayer = -1;
}

public boolean checkFilter(GamePiece piece) {
final String s = propertyFilter.getExpression().trim();
if (s.isEmpty()) {
return true;
}
return propertyFilter.accept(piece);
}

@Override
public boolean accept(GamePiece piece) {
return accept(piece, 0, "");
Expand Down Expand Up @@ -664,7 +672,7 @@ public boolean accept(GamePiece piece, int layer, String layerName) {

// Looking at All Layers accepts anything.
else if (displayWhat.equals(ALL_LAYERS)) {
return propertyFilter.accept(piece);
return checkFilter(piece);
}
else {

Expand All @@ -674,14 +682,14 @@ else if (displayWhat.equals(ALL_LAYERS)) {

// Pieces are passed to us top down, so only display the top-most layer
if (displayWhat.equals(TOP_LAYER)) {
return (layer == topLayer) && propertyFilter.accept(piece);
return (layer == topLayer) && checkFilter(piece);
}

// Include pieces on named layers only
else if (displayWhat.equals(INC_LAYERS)) {
for (final String displayLayer : displayLayers) {
if (layerName.equals(displayLayer)) {
return propertyFilter.accept(piece);
return checkFilter(piece);
}
}
}
Expand All @@ -693,7 +701,7 @@ else if (displayWhat.equals(EXC_LAYERS)) {
return false;
}
}
return propertyFilter.accept(piece);
return checkFilter(piece);
}
}

Expand Down

0 comments on commit 92014d1

Please sign in to comment.