Skip to content

Commit

Permalink
Port SchemBrowser optimization to SchemDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
buthed010203 committed Nov 10, 2024
1 parent 4dbc635 commit 77a6cc1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion core/src/mindustry/client/ui/SchematicBrowserDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public void draw() { // Update the name in the draw method as update() is called
/** Custom hit implementation that respects the cullingArea. Allows for significantly larger schem repos without lag */
@Override
public Element hit(float x, float y, boolean touchable){
// if (cullingArea == null) return super.hit(x, y, touchable); // Fallback to vanilla behavior if cullingArea is null
// if(cullingArea == null) return super.hit(x, y, touchable); // Fallback to vanilla behavior if cullingArea is null

float cullLeft = cullingArea.x;
float cullRight = cullLeft + cullingArea.width;
Expand Down
2 changes: 1 addition & 1 deletion core/src/mindustry/ui/dialogs/SchematicsDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public void draw() { // Update the name in the draw method as update() is called
}){
@Override
public Element hit(float x, float y, boolean touchable){
if (cullingArea == null) return super.hit(x, y, touchable); // Fallback to vanilla behavior if cullingArea is null. Only happens for a few frames on open
if(cullingArea == null) return super.hit(x, y, touchable); // Fallback to vanilla behavior if cullingArea is null. Only happens for a few frames on open

float cullLeft = cullingArea.x;
float cullRight = cullLeft + cullingArea.width;
Expand Down

0 comments on commit 77a6cc1

Please sign in to comment.