Skip to content

Commit

Permalink
Reverted hit() optimizations for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Anuken committed Sep 6, 2024
1 parent 3284de5 commit 29c4199
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions arc-core/src/arc/scene/Scene.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,19 +90,20 @@ public void registerStyles(Class<?> type){

public void registerStyles(Object obj){
Seq.with(obj.getClass().getFields())
.each(f -> f.getName().startsWith("default"), f -> addStyle(f.getType(), Reflect.get(obj, f)));
.each(f -> f.getName().startsWith("default"), f -> addStyle(f.getType(), Reflect.get(obj, f)));
}

public @Nullable Element getHoverElement(){
return mouseOverElement;
//TODO: this is slow, use mouseOverElement instead?
return hit(Core.input.mouseX(), Core.input.mouseY(), true);
}

public boolean hasField(){
return getKeyboardFocus() instanceof TextField;
}

public boolean hasMouse(){
return mouseOverElement != null;
return getHoverElement() != null;
}

public boolean hasMouse(float mousex, float mousey){
Expand Down

0 comments on commit 29c4199

Please sign in to comment.