Skip to content

Commit

Permalink
feat: Add UIScrollPane#fit.
Browse files Browse the repository at this point in the history
  • Loading branch information
teletha committed Oct 3, 2023
1 parent cad1e3d commit 4b0ce35
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main/java/viewtify/ui/UIScrollPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import javafx.scene.layout.Priority;
import javafx.scene.layout.VBox;
import javafx.util.Duration;

import viewtify.ui.anime.SwapAnime;

public class UIScrollPane extends UserInterface<UIScrollPane, ScrollPane> {
Expand Down Expand Up @@ -54,6 +53,19 @@ public UIScrollPane policy(ScrollBarPolicy horizontal, ScrollBarPolicy vertical)
return this;
}

/**
* Set box fitting policy.
*
* @param width
* @param height
*/
public UIScrollPane fit(boolean width, boolean height) {
ui.setFitToWidth(width);
ui.setFitToHeight(height);

return this;
}

/**
* Set the first child content.
*
Expand Down

0 comments on commit 4b0ce35

Please sign in to comment.