Skip to content

Commit

Permalink
fix(hui): hare buttons flowpane sizing
Browse files Browse the repository at this point in the history
  • Loading branch information
xeruf committed Jul 4, 2024
1 parent 7e2c5d2 commit b6f06af
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/main/kotlin/sc/gui/view/HuIBoard.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ import javafx.geometry.HPos
import javafx.geometry.Orientation
import javafx.geometry.Point2D
import javafx.geometry.Pos
import javafx.scene.Group
import javafx.scene.Node
import javafx.scene.control.Button
import javafx.scene.control.Label
import javafx.scene.control.Tooltip
import javafx.scene.effect.ColorAdjust
import javafx.scene.input.KeyEvent
import javafx.scene.layout.*
import javafx.scene.shape.Rectangle
import javafx.util.Duration
import sc.api.plugins.Team
import sc.gui.AppStyle
Expand Down Expand Up @@ -256,17 +256,14 @@ class HuIBoard: GameBoard<GameState>() {
if(currentPos + maxAdvance < targetPos || state.checkAdvance(distance) != null)
return@forEachIndexed
val flow = FlowPane(Orientation.HORIZONTAL).apply {
maxWidthProperty().bind(graphicSize)
clip = Rectangle().apply {
widthProperty().bind(graphicSize)
heightProperty().bind(graphicSize)
}
hgap = AppStyle.miniSpacing
vgap = AppStyle.miniSpacing
this.prefWidthProperty().bind(graphicSize)
this.maxWidthProperty().bind(graphicSize)
this.hgap = AppStyle.miniSpacing
this.vgap = AppStyle.miniSpacing
}
var totalCards = 0
state.possibleCardMoves(distance)?.also {
putOnPosition(flow, targetPos)
putOnPosition(Group(Group(flow).apply { this.isManaged = false }), targetPos)
totalCards = it.sumOf { it.getCards().size }
}?.forEach { advance ->
val cards = advance.getCards()
Expand Down

0 comments on commit b6f06af

Please sign in to comment.